As far as I understand, if you’ve used the built in authorisation methods, a user will be redirected to your login page if they aren’t logged in already and they attempt to access a protected resource. They will be redirected to their requested page after they log in successfully.
The user should only see the error page if they’re already logged in but don’t have the required permissions.
This is how all of my sites have worked and I haven’t had to do any customisation to achieve it. I’d suggest checking through the guide to determine if you’ve missed any steps to enable this functionality: