Lately I've encountered quite big issues with javascript after a core upgrade. At first, it wasn't easy to debug. Later, I came to this thread, mentioning big_pipe module as the culprit.
The solution
One solution is to disable the big_pipe module. Then the issue disappears.
But because this is quite an important module for performance, we used this patch:
to composer.json, add this core patch to the "patches" section in order to add big_pipe to the header javascript:
"patches": {
"drupal/core":
{
"Javascript weight issue fix": "https://www.drupal.org/files/issues/2024-12-31/drupal-core--2024-12-31--3496329--mr-10753.patch"
}
}