It’s completely logical that the first button should receive focus when the document is in read mode. A read mode document has no fields, so there is no field to get the focus. The only thing on the document that can get focus is the button.
The simple solution would be to remove the buttons when the document is in read mode, or add some other control on the document that can receive focus.
If there are no controls on the document, the document itself will have focus.