What I don’t understand however is why it partially works? Why can I run nc if PHP itself is broken?
Nextcloud Server itself - at least the web app portion - runs under the Apache/mod_php or FPM PHP SAPIs. The command line bits (occ) run under the CLI PHP SAPI.
Since you’re using FrankenPHP you’re in uncharted territory with Nextcloud. Does FrankenPHP require you to trigger PHP via their binary for some reason even at the command line? That seems unnecessary since I thought it was basically just an app server for PHP.