This is a known problem and I can not recreate it.
It does not reset for me.
So it is now time to enlist the player community in to group debugging to find out how and where it gets reset to narrow the search.
/data has been modified to show the last castle quest completed.
As you go through the area, especially before and after any portals, type /data to see if it has changed.
I need to know how and where it resets to find what triggers it and hence which piece of code it the guilty party.
The 3 suspect parties, the initial portal in the white room, the group portal at the start of each quest and the final portal at the end have been tested to death by me and I can never get them to fail.
Armed with /data I hope someone will work out what triggers it so I know where to look.
Good hunting.