I ran into this issue specifically in the context of a Django application deployed on Render, but these steps should work for any stack running locally in a Docker container.
I encountered an error in production that did not occur in my local environment. I needed to debug the issue locally, but I needed a copy of the production database to properly debug it.
My application is deployed on Render, which takes daily backups automatically. The Render docs explain how the backup files are created. I was able to just download the .sql.gz file of the latest backup through the Render dashboard.