You may get a "Permissions needed" error when trying to upload files with OneDrive for work or school for any of the following reasons:
You have read-only permission to the SharePoint in Microsoft 365 library, and edit permission is required for uploading files. If you previously uploaded files to this library successfully, it's possible that an administrator changed your permissions. Ask your administrator to give you edit permission.
The file type requires "Add and Customize" permission. The following types of files require this permission: aspx, master, xap, swf, jar, asmx, ascx, xsf, and htc.
Typically, only system administrators have this permission. For more information, see Overview of the Contribute permission level in SharePoint 2013.
You might have signed into Microsoft 365 using an account in which you don't have permission to upload files using OneDrive for work or school. For example, you might have signed in using a Microsoft account instead of your work or school account.
To see the email address under which you're signed in, open any Office application such as Word, select File>Account, and look under User Information.
To change to a different account, select Switch Account on the Account page to open the Sign In dialog box.