5E leaves it open to interpretation, probably deliberately. For some groups, warlocks/clerics channel their patron's power, and the patron can stop the flow at will. For other groups, warlocks/clerics are given a fragment of the patron's power, and it remains a part of them even if they go rogue.
Personally, I like facilitating the possibility of rebellious clerics and warlocks, so I favor the latter approach. For warlocks in particular, conflict between them and their patron is a grand old trope and I wouldn't dream of squelching it. For clerics, since they do pray for their spell preparation, I think a hybrid approach is appropriate: a cleric on the outs with their god keeps their current spell list and can refresh spell slots -- they're part of their own ability, not their god's -- but they can't prepare different spells until they atone or else find a new god.
Also remember that even if a cleric or warlock keeps their power, that doesn't mean pissing off their patron is consequence-free. The pact between a warlock and an archdevil is likely to have some pretty nasty punitive clauses vis a vis the ultimate fate of one's soul, and the fiend is likely to take a personal interest in their being enforced sooner rather than later. Other patrons may be similarly vengeful -- although some Great Old Ones might not even be aware of the warlock's existence, much less their petty, futile revolt against the inevitable. As for clerics, gods have temples and religions on their side, and being branded a heretic or apostate is seldom a profitable career choice.