I don’t think it ever took me so long to fix a permission issue in a WordPress development environment. I checked my docker-compose file. I logged into to the containers to confirm I could write as the web user. It was all good.
The issue? There was a database entry that defined a custom path for uploads.
Make sure that there’s no custom path defined in Settings -> Media.
If that doesn’t fix it for you, then you might want to check these articles: