Error: All items have already been transferred for this Work Order

I am getting this weird error saying “All items have already been transferred for this Work Order”
Steps performed:

  1. Created Work Orders through Production Planning
  2. Started Work Order by clicking the Start button on Work Order that triggers the Stock Entry to transfer Raw Materials
    I tried interpreting the code at erpnext/ at a55e4e2c03e057a346c1acd27f4ccf9555e00554 · frappe/erpnext · GitHub
    It seems the error is thrown when the Quantity of Raw Material is already transferred but the table on Work Order does not show any Transferred Quantity

Attaching images for reference

I was able to Debug the issue.
ERPNext threw the error message as the Item Master did not have “Include Item in Manufacturing” flag set to Yes. This happened since the Item Master was imported via the Excel Import tool and the value for “Include Item in Manufacturing” was not set to Yes.
Also, I had to create a new BOM for the Item (FG) once the value was set to Yes since the previous BOM had wrong values stored in it.