This is an update, not a create. If the site is in dedicated mode there should always be a farm:

That's checked a few lines above (L150):
throw new Error('Instances can only be changed for sites in reserved mode');