OK, this is weird. I just re-installed LibreELEC on the Pi5 from scratch again, restored the config from the Pi4 and now it works as it should. WTF? There's absolutely nothing I did differently than before!
But something strange happened: After restring the config and rebooting, the screen remained completely black but I was able to boot into LE via SSH.
Can you be precise with the sequence here.
1. Fresh install of LE on Pi5 from scratch works fine
2. "restored the config from the Pi4" - did you copy .kodi directory or use an backup/restore addon? And this works fine.
3. "After restring the config and rebooting, the screen remained completely black" do you just mean a reboot compared to the previous step, or did you restore something else?
Assuming step 2 was working without a reboot, then kodi is likely not using the restored config.
It may be interesting to identify what file in the config is the one that causes the issue. guisettings.xml is the most likely.
(But I don't know if you are restoring anything else, like contents of /flash partition).