Can you access these resources directly in the browser (change https://moodle.example.com to your site's URL):
https://moodle.example.com/lib/javascript.php
You should get No valid javascript files found.
https://moodle.example.com/lib/javascript.php/-1/lib/javascript-static.js
You should see some JavaScript source code:
// Miscellaneous core Javascript functions for Moodle
// Global M object is initilised in inline javascript
⋮
Do you get these? I'm wondering if there's a configuration issue with slasharguments on the server. You could try adding $CFG->slasharguments = false; to config.php, it's not the recommended setting but it might indicate what the issue is.