The second argument of the createForm() helper should contain the initial data of your form. It may be an entity but it also could be an array.
You don't really need to return the entity from your action, unless you need to use it within your template.
createForm()
signature,
public Form createForm(string|FormTypeInterface $type, mixed $data = null, array $options = array())
where,
mixed | $data | The initial data for the form