The behavior you're experiencing seems to be related to the forceRedirect flag. When forceRedirect is set to true, Shopify App Bridge will attempt to redirect users to the Shopify admin page that embeds your app automatically when it detects your app is loaded outside of Shopify admin.
If your app is not yet installed on the store, it might attempt to redirect to a non-existent page (since the app is not installed yet), hence the 404 error.
Here are some things you could try:
Conditionally set forceRedirect: You might want to only set forceRedirect to true when your app is already installed. You can check if your app is installed by making an authenticated request to the Shopify REST Admin API and checking the response.
Install your app programmatically: If your app is not yet installed, you could redirect users to an installation page, or you could use the Shopify Billing API to create a recurring application charge and then activate it, which installs your app on the store.
Handle 404 errors: You could also handle 404 errors on your app and redirect users to an appropriate page (like an installation page or an error page).
Try out the above approaches and let us know if you're still having issues.