I know this issue has been resolved as "CNR" 3 times already, but I think the issue definitely reproduces if 3 people have had it.
When I summon a large explosion of any kind (for instance, with ExplosionPower 1500 or just a lot of TNT [more than 50]) while I have resistance 255, the game lags severely. After the lag ends, I find that switching back to creative then to survival mode again causes me not to take damage from TNT.
By the way, sorry about the length of the video, but the issue is shown at the end (last 10-20 seconds) of this youtube video.
The issue persists through world copies, backups, reloads, and game restarts (In fact, I've had it for years (since 1.8.9, but also on newer worlds like ones created in 1.14.2), no joke).
I can't seem to get the affects versions tab to label that it has affected those versions, however.
ALRIGHT, CAN SOMEONE RESOLVE THIS ISSUE?
It turns out that I'm an idiot and left my game on peaceful while testing something during the night. So, this report is INVALID. However, I have had this issue previously on my survival worlds, so maybe if this happens again I will report it properly.