Set up a virgin moodle.
Create a Course.
Login as user without any rights for that Chat.
Try to access.
You should get an error: "Sorry, but you do not currently have permissions to do that (Talk in a chat)"
What you see is the browser complaining about invalid tag-folding in
</div> <!-- end div content -->
Have a look at the delivered markup: the error breaks conntent-delivery just inside a tables cell. Don't know how to solve that, but why would the chat-module force XML-output via <xml... declaration? Could that be surpressed if any error-printing is predictable?
Apreciate Your work,