But upon reflection, I am not so sure. The guess usually will be right. I prefer the guessing to continue from a performance and usability perspective since I believe the number of cases of different protection for a sub-tree to be far fewer than the number of cases where the same protection applies. It should be trivial for your example browser to notice the realm change and not issue the error dialog.
Basic authentication is so problematic re.
There are significant fish to fry like encouraging servers to not require system user directory entries for web user access, like getting digest authentication adopted, etc.