The error is coming from the GetByID call itself nothing after it is causing it. If you don’t want the error you need to stop using GetByID (or check if the record exists and skip the GetByID all together if it doesn’t)
To use GetRows you need to pass in a whereClause in your case for the PartPlant WhereClause you can leave the rest of the whereClauses as ignore that’s fine
Perhaps the easiest thing to do for you since you are taken a back by GetRows, is check if the record exists (yourself) by using a condition Query and if the record doesn’t exist then skip around the logic.