Very Strange Issue in Authentication - Cause Roles to come back wrong

Manage to reproduce the issue. Here is the git repo.

Download the repo and run it. Go to https://localhost:5001/login and login as andy.fensham@scadsoftware.com. Password is in the repo. It will bring back that I am in Admin and SysAdmin Role.

Then downgrade to earlier version 6.3.0 or 6.2.1. Again login as andy.fensham@scadsoftware.com. It will show you are in Admin Role only. Also , on the 6.3.1 package, browsing to users show empty users in 6.3.1.