(Basically the EmacsWiki version does NOT show this bug but follow on changes added this bug.)
From Vinicius Latorre.....
I've just tested the steps in bug report #37467, my results:
1. Using whitespace-mode distributed with Emacs 27.0.50, the bug happens.
2. Using whitespace-mode in EmacsWiki, the bug does not happen.
I didn't see in deep to verify exactly what is going on.
Vinicius
PS1: The whitespace.el file distributed with Emacs has a lot of modifications, probably it could start with whitespace.el in EmacsWiki and adding one by one the modifications until reach the bug.
PS2: I saw that all save-match-data was removed from whitespace.el, this could be a starting point, that is, add again save-match-data at original point and check if the bug happens.
-----------------