As someone who's been jailbreaking since the iPhone 3GS (and held onto a iOS 17.0 device for the longest time), Apple has never bothered to detect jailbreaks and lock people out of iCloud and iMessage.
If anything, it's those sleazy security framework providers that provide jailbreak detection to apps and cause them to either lock people out of accounts and features, or crash entirely.
Some government-mandated audit processes (at least, that's what I understand here in Singapore) also require jailbreak detection.