No lines drawn if 'GROUP BY time()' interval NOT explicitly defined

the $__interval variable is dynamic and dependent on time range and how wide the graph is. So when you go into edit mode the panel is much wider and the next refresh is going to cause a different interval.

Your problem is exactly the same as Why is my graph empty when I zoom in?

Did you try set a lower limit to your group by time so that the auto interval variable $__interval never goes below the rate of which you write data? Or did you try changing fill(null) to fill(none) ?