Really? That easy? You can't even imagine a situation where it would be a game-changer to have an entire church/cult and their members hunting you down? Even if you're powerful enough to beat them, that would be a huge consequence to betraying the person that gave you magic.
Not in 5e they can't.
Not in 5e. The classes are purposefully designed that the magic Clerics and Warlocks get isn't revocable.
They "try" to turn you into a monster. That doesn't mean they succeed. The DM could build in a side-quest to cure the curse/find a magic item that stops it. It could be a fun side quest. "You lose your class features and are useless to the party" isn't as ripe for drama and in-game tension.
What's more interesting, being a fugitive former-member of a prominent church/cult that's being hunted down by their former allies that also has to figure out how to end a curse or be turned into a monster in a certain time-frame, while also dealing with the main plot of the campaign, or just being a dude without magic because the DM/Paton has absolute authority to take away your magic at any moment.