If you want to stick with RAW, then the DM is in charge of playing all NPCs, including the omniscient and omnipotent deities. The DM is entirely within RAW to say that the cleric or warlock loses their magical ability when they gravely offend their patron deity, because that is what the patron would do in those circumstances.
In previous editions, paladins could fall and lose their class abilities. We
know this, because the rules said so. Rules As Written.
But in 5e, such rules are conspicuous by their absence. The lack of such rules =/= these rules exist RAW, because Rules As NOT Written are not Rules AS Written.
If you make a pact with a deity, and then turn your back on them, you would be lucky if you get to retire in obscurity rather than being struck down and tortured for all eternity.
First, the examples I quoted from the very fiction that inspired the hobby, plus
actual written 5e text to the tune of some patrons don't pay any attention to their warlocks, shows clearly that it is NOT a given that such beings automatically punish transgressors.
Second, even those beings who are inclined to punish wayward servants do so by in-game means, such as sending more and more powerful loyal servants to persuade/kill the naughty PCs. What they
don't do is punish them by metagaming! They don't mess with our real world character sheets, they mess with the game-world characters!
If the player isn't going to play their character seriously, then they are abusing the good will of the entire group (who have devoted significant time and effort to the campaign), and such a player is unlikely to be welcome back regardless.
And here is an assumption: the player is deliberately playing
wrong! But in my experience what happens is that the player and DM disagree about the best way to role-play their devotion. In real life religious people, even of the same religion/denomination/church disagree about religious matters, and each still goes on happily being a member of that religion. But the DMs I'm talking about say it's their way or the highway, taking away the player's agency.
The first example character in my previous post was a Pal/War whose parents sold her soul to a fiend, left her on the steps of the temple to Helm, was brought up and trained to be a good paladin, while the fiend was secretly rubbing his hands with glee in the thought that he could slowly corrupt a high level paladin. It just would not make ANY sense for the fiend to take her warlock powers away because that would defeat the fiend's own object, and it wouldn't make any sense for Helm to cripple his own paladin's fight against the will of the fiend.
Yet, on this forum and in real life, the knee-jerk reaction of some DMs is, "Paladin/Warlock? The player MUST be making a mockery of the story and the PC cannot possibly make sense!" Ban, ban, ban!