After a lot of hours I figured out how to finally get this working properly.
It turns out that the first person to view a thread via showthread.php would cache that version of the thread in vb_postparsed - so if a guest views the thread first it is cached with the replaced text and everyone else who uses that style logged in or not will have the cached version.
I've managed to get around this by having a copy of a style dedicated to guests, setting it as the default and using the Restrict Style to Usergroup mod
https://vborg.vbsupport.ru/showthread.php?t=95910 to prevent logged in members from changing to that style.