This all seems a bit complex as most other sites/platforms/user directories are capable of creating user names in bulk (or individually as required). They provide a “use once” password, send an activation link to the new user to log on using the use once password, then force the user to create a personal password that is not accessible to anyone but the user.
Creating code to do this standard action will make the site brittle and the custom codeset may break when Wix provides updates to the core system.
Common practice it seems everywhere except Wix.