Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
This means that you should not be using the PowerShell cmdlets that include "msol" in their name (following the "-" character).
Instead, you should be using cmdlets which include "mg" in their name (following the "-" character).
To create a user, follow https://learn.microsoft.com/en-us/microsoft-365/enterprise/create-user-accounts-with-microsoft-365-powershell?view=o365-worldwide
To set a license, follow https://learn.microsoft.com/en-us/microsoft-365/enterprise/assign-licenses-to-user-accounts-with-microsoft-365-powershell?view=o365-worldwide
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin