If in dev mode, combined files are not used. This would explain why it works in dev mode.
The alternative is to just disable this completely, addng this into mysite/_config.php
The _combinedfiles folder was created but had no write permission. It was an empty folder. The reason it could not be set with correct permission probably is that it was owned by the apache server, not the script. I then just add Requirements::set_combined_files_enabled(false); to the _config.php file and it works.
I don't actually understand what the "combined files" thing is and why it is used in live mode by default but not in dev mode. Is there any documents explaining this bit on the SS official site? I'd like to learn something about it.