Creating a session for another user programatically seems really strange, what exactly are you trying to achieve?
If you want to create metadata for an identity, you don't need the user session, you should even be able to set the metadata in the original POST. If you want the user to create the identity and then have your backend update the metadata, I would use a webhook to set the metadata, so the user can still follow the regular registration flow - for example the registration.after action - it's all documented here:
https://www.ory.sh/docs/kratos/hooks/configure-hooks#web-hooks