I've had my server up since 23rd Dec and I've just started seeing this issue within the last 24 hours.
I've confirmed that a period of (chat) inactivity causes this, and it doesn't happen on a second message shortly after.
Edit: I'd just like to add that I'm not in agreeance of the title of this bug (subtle freeze). When this occurs in my server, it locks up everyone playing for anywhere from 0.5 to 2 seconds, which is very disruptive.
Had a couple players kicked for flying while using scaffolding on my 1.18.1 server.
Both times players logged back in to have fallen to their deaths