There are two main reasons why you get a 404 error after setting up a custom GTM loader:
1. You've added SERVER GTM ID instead of WEB GTM to the custom loader power-up. Check that you see WEB GTM ID in the custom GTM loader settings.
2. Web container is not published.