so I noticed that if I turn on the TV first and then the PI, Kodi always starts properly. But as soon as I leave the TV off and start the PI, it doesn't work. The Pi then starts the TV via CEC and there is only the white writing at the top left with Libreelec 10....
Some displays don't allow resolutions supported (edid) to be read when powered off, or to determine the device is connected (hotplug). Some do.
You can use "getedid create" from wiki to store the edid to a file, and allow TV/Pi to be powered in either order.