Preview mode works but Live version does not

Hey there,
I installed Matomo on a React/NextJs project. It tracks the Active Users correctly. But when I installed Matomo Tag Manager ( I needed it it to track button clicks ) it fires the Trigger on Preview mode, but there is an error in the console 404 Not Found.