This is not a bug, but the result of display names loading asynchronously (when not present in the cache).
I.e. when a new avatar arrives, the viewer makes a request for their display name as soon as the latter is needed: if you do not have the name tags display enabled with the display names in them, the request will only be done after something else happens: IM sent by that avatar, chat posted by them, one of their scripts sending a scripted menu dialog to you, etc.
You will also see this happening for the very first IM of any given avatar which name was not cached already (or got evicted from the cache after a while): this is the "expected behaviour"...
LL's v2+ viewers (and their TPV forks) have an UI callback implemented to update all the UI text elements already displayed as soon as the display name is received: this is not the case of the v1 UI, and I do not intend to change this, because LL's v2 code changes to implement just this callback involve a very significant increase in memory consumption, CPU cache lines consumption, etc, meaning a more bloated and slower UI (basically, every single text element in the UI gets bloated with additional data which 99% of them won't even use, because they will never need this callback mechanism).
If you want display names to appear in chat at the first post of an avatar, enable the name tag (even if only in their "display only temporarily" mode). Or, you could also use Lua to automatically make a request for an avatar display name at each new avatar rezzing event, in the OnAvatarRezzing() Lua callback of your automation.lua script, like so: