I tried the message in my environment and actually this is a configuration issue. The access denied message is a system message and as a result it is displayed using the “Status Messages” block. I am not sure if you have the same environment in order to test it but you can give it a go. I tried it in my environment and it works.