Interesting the difference between UK and USA here. Spray foam applied directly underneath the roof deck is very common here and is a recommended assembly by building scientists, e.g. https://buildingscience.com/documents/digests/bsd-149-unvent... Not sure if there is a significant climate difference in the UK that makes this construction more problematic, the article mentions moisture but the U.S. building scientist…
The reason it's nonsense is that the side covered with foam (especially closed cell) is now protected by waterproof polyurethane. Water isn't getting to that side.
The other side is now insulated from the inside, so that isn't getting things like condensation because the temperature differences should be negligible. If people think about a cheap styrofoam cooler, it's cold on the inside and there isn't condensation on the outside on a humid summer day. The outside isn't cold, that's the point, so condensation doesn't happen there.
Then maybe someone would say if there was a roof leak the wood would get wet and rot, but that would happen anyway. That's a major disaster and foam won't cause any more problems than are already happening.