Reading all this, it occurs to me that the simplest way of addressing the situation with the minimal amount of code change would be adding a requirement that a person who has achieved a senior rank or higher cannot be removed/demoted from their office without a vote of the elders. At which point the accused would have an opportunity to plead their case.
If a vote is required to excommunicate someone from a religion, then a vote should also be required to reinstate them.
I would also suggest that a regent should not be able to make someone a prophet (or another regent) by themselves, that should be voted on by the elders as well.
This seems like simple common sense stuff to me. Comments?