Fix for #25371 where creating a new task could sometimes fail.
Specifically, if creating a new task on an entity that didn't share the
step from the current context it would error.