Production mode – js load issues after upgrade to 2.4.7

I recently did upgrade my magento from 2.4.4 to 2.4.7

While running frontend in production mode, there are lots of issues regarding js file load.

Example:

The resource from “https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

As I understand, the file which supposed to be loaded, should be mage/common.min.js not mage/common.js

Looking in the developer console in firefox/chrome/edge I can see that the file loading goes as follow:

https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.min.js

https://magento.local/static/version1716768798/frontend/XXX/base/en_GB/mage/common.js

For unknown reason, the file is loaded twice.
The first one is a success, the other is not.

The issue only occurs in production mode.

It seems this issue is somehow related to require-config.js
All files that are failing are somehow put somewhere within the ‘deps’ node.

Example:
html/vendor/magento/module-theme/view/frontend/requirejs-config.js

deps: [
        'mage/common',
        'mage/dataPost',
        'mage/bootstrap'
    ],

All those are loaded twice(firstly minified and then non-minified) and the non-minified fails to load.

Any clues, why this could happen or where to look for solution?
My last gas is to install fresh 2.4.7, check it there and apply all the updates I have.

edit

I did reproduce this on a clean magento.

I did open a ticket on magento some time ago and it seems there are others facing the same issue.

The problem is very tricky to reproduce, I was able to reproduce this with my teammates on my project, but the source of the error is unknow.

https://github.com/magento/magento2/issues/38829#issuecomment-2582543011