Typically, this error can happen if you try to push a large git repository over HTTPS, I understand you have already changed the git configuration on the local machine to make the postBuffer bigger.
Could you please try the following way and check if it makes any difference.
git config --global http.postBuffer 524288000
To isolate the issue further, please try these:
1. Verify if there is any firewall or proxy blocking the connection.
2. Try pushing the code from a different network or machine.