502 Bad Gateway after strapi switch database

I have a feeling it would be the host the user is tied to, it’s possible your MySQL database saw the user request coming from a different IP so passing that wildcard (basically accept from any IP %) is likely what fixed the issue.