I got the same error message, When I try to upload the file using SharePoint REST API :

To resolve the error, you have to add permission Full Control permission to your application.
Initially, I registered Single-Tenant Microsoft Entra ID Application and Added delegated type API permission like below and granted admin consent:

Configured Authentication tab like below:

Use below PowerShell script :
Connect-PnPOnline {tenant}.sharepoint.com -Interactive -ClientID <application_id>
Grant-PnPAzureADAppSitePermission -AppId "<client-id>" -Site "https://{tenant}.sharepoint.com/sites/{your-site}" -Permissions FullControl

Using delegated type, authorization_code flow which requires user-interaction. To get code, I ran below authorization request in browser:
https://login.microsoftonline.com/{Tenant-ID}/oauth2/v2.0/authorize?
client_id=<CLIENT_ID>
&response_type=code
&redirect_uri=http://localhost:58310
&response_mode=query
&scope=https://{tenant}.sharepoint.com/.default
&state=12345

After successfully creating authorization_code, Generated access token using below parameters:
Headers:
Accept: application/json;odata=verbose
Content-Type: application/octet-stream
Body:
POST https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
Body: FormEncoded
client_id: <application-id>
scope: https://{tenant}.sharepoint.com/.default
grant_type: authorization_code
code: <authorization_code generated from browser>
redirect_uri: http://localhost:58310
Response:

Now, Use below endpoints to upload the .png file:
POST https://{tenantID}.sharepoint.com/sites/{mySite}/_api/web/GetFolderByServerRelativeUrl('/sites/{mySite}/Documents')/Files/add(url='<YOUR_FILE>',overwrite=true)
Response:

Also, I've verified from SharePoint App, .png is uploaded successfully.

Reference:
Connect-PnPOnline Blog