The usual way to compile from Vim is to use :make. From :h :make:
:mak[e][!] [arguments] 1. All relevant |QuickFixCmdPre| autocommands are
2. If the 'autowrite' option is on, write any changed
3. An errorfile name is made from 'makeef'. If
'makeef' doesn't contain "##", ...
Using 0read on BufNewFile actually works as expected, in fact the documentation for BufNewFile explicitly mentions using that event for loading a template or skeleton file.
If we also rule out the other things that might have gone wrong there, then the most likely explanation is that 0read is working, but the contents of the buffer are later erased by ...