How to re-create:
Get a sword or trident from your inventory in creative mode
Walk around in circles while holding down the sword on a block
Observe as the game freezes up for a fraction of a second. The items you have in your hand might also have a visual glitch.
Footage: https://youtu.be/iqv4CQakZKc
This does not happen in survival mode, or with any other item in creative mode. It applies to all types of swords, and the trident. It does not apply to attack mobs. It also only happens while the player is moving. My theory is that the algorithm that makes swords not be able to break blocks is inefficient.
Linked issues
Comments

This issue duplicates MC-157436.
If you have not already, please use the search function to see if your issue has already been reported.