When I try to compare two or more permission schemas on Jira 5.1 I do get an error complaining about some schemes which cannot be compared.
Jira logs contains no hints on what would generate the problem. Even more interesting, if you select more schemes you may end-up being able to see a scheme which was giving the error in other configuration.
The database sanity reports no problems and restarting the server also does not solve the problem.