THere is a middle ground which is this: https://www.wienerberger.co.uk/products/roof/in-roof-solar.h...
The big problem is that because there is no real ventilation, the panels get hotter and don't produce as much power.
What you put under them also has an effect on how waterproof your roof is long term, plus when you need to replace them finding ones that are the right size are also a pain.