This is the bug that was supposedly fixed last week:
https://github.com/discourse/discourse/pull/16688
The above PR fixes the obvious case of having the same topic in two different tabs / browsers / devices.
You can still trigger it if the second tab is so old that the MessageBus backlog was flushed and the app can’t recover the full history from it. No other way around.
If you find a way to repro this in another way in an up to date instance please fill a bug report about it with repro steps.