Over the years as a GM, I’ve come to think of alignments as the “religion” the character was raised in, but eventually gets tired of living with. Just like some Christians who break the law and violate commandments, the PC will find some way of justifying their actions. If their “religion” (fellow LGs) catch wind of their misdeeds, then they might hold judgment. If word gets out that the LG ranger met with a swamp witch, that would raise some eyebrows of other LGs. If the ranger were to go to his temple and request a resurrection spell later, the high priest may say “First, what’s this about you consorting with a swamp witch?” They’d be concerned about their reputation and the so-called appearance of impropriety.
There’s also ramifications of the ranger decides to kill the swamp witch. Maybe she has family who decide to seek revenge and ambush the party later. Maybe killing her undoes some kind of pact she had with demons/devils and they’re now free to wreak havoc. Don’t make it a matter of redefining their alignment. Make the fallout external, not internal.
In the last Pathfinder campaign I ran before COVID shut down my RPG hobby for good, I ran a campaign based on the Crotalorn Empire from Brain McNaughton’s “The Throne of Bones.” In a nutshell, the Empire is on its last days, and it entails two warring clans, the Vendrens and the Fands. The Vendrens can be described as evil, as they’re usually backstabbing, selfish, paranoid, entitled, and likely to delve into the dark arts. The Fands aren’t much better. They believe themselves to be descended from dragons, so they’re conceited bullies who have little imagination and see everything in terms of black and white.
The main PC was Pharcos, a paladin who was contacted by another PC who works for the Vendrens, but secretly despises them and wants to poison them from within. Turns out Pharcos is actually a Vendren, and they want him back to present a more solid united front against their enemies, the Fands. So, you have a character who’s ostensibly LG, whose mostly LE family wants in their good graces. Pharcos is a worshipper of the Sun god, who the Vendrens pretend to worship, but have secretly replaced the priests of that religion with sorcerers who can fake cleric spells. So, there’s a reason why a LG character would want to return, to undo all the damage his family is responsible for.
Thing is, the player let the fact that he’s now a noble get to his head (which I knew he would, because the guy playing Pharcos was that kind of personality), so he started acting like he was the Second Coming, and considered anybody who got in his way evil. That usually happened to be ordinary citizens who didn’t WANT the empire to return to power. Pharcos got angry at a peasant who dared insult him, and one whole session became a kangaroo court where he judged the peasant in front of a crowd of citizens and executed him by beheading.
Yes, I realize that’s cause for the Sun god to come parting the clouds with thunder and lightening and punishing Pharcos on the spot. That’s probably what I would have done in the old days. But I decided to not to go that route. The gods didn’t do anything to prevent the Crotalorn Empire from crumbling, so I decided they wouldn’t intervene because they lacked the desire or ability to do so, much as when the Romans eventually tired of their gods. So, I had Pharcos later get visions of Sleethreethra, goddess of evil, carrying around the peasant’s head and snogging it. His healing spells became temporary until he properly “atoned” himself. Killing the boss of the next adventure fits the bill.
So naturally, the Vendrens get wind of this and he becomes their Donald Trump. They approve of his actions, while the “good” people consider Pharcos evil. PCs on the whole don’t really care about politics and just want to kill monsters and get treasure, and were getting weary of having to act as Pharcos’s damage control. It led to a lot of funny and awkward situations at least.
Just saying, you don’t have to resort to divine intervention or split hairs on the proper ways to act LG. There’s lots of entertaining stories about characters having to fix the messes they made, and this could turn into such an event.