Problems with authorizing google analytics

We experience problems with authorizong matomo and google analytics.

According to the instructions we created a JSON file. When we upload it in matomo google analytics importer and press the button authorize the next screen asks for the google analytics loginname, confirmation goes OK. Then we confirm the warning about the unverified app. After that we give the final confimation and apply.
Then de screen keeps on “loading” till is reaches a 504 - Gateway timeout. We cannot find out where it goes wrong. Can someone give us a hint or solution?

System: Linux RHEL 8.7
Nginx 1.24.0
Matomo: 4.14.2
PHP: 8.1.19
SQL: 8.0.30
Google Anayltis Importer: 4.6.5