If you use the new debug options to make the local difficulty element visible either In F3 or Always and then hide the GUI, you will notice that the line rapidly appears and disappears even when standing still. It is especially noticeable when the F3 screen is open, as any elements that are below it on the same side will move up to fill the blank space and then move down again when it reappears.
The issue when crossing chunk borders is already tracked in MC-299755. I have reduced the scope of this report accordingly.