As you can see in this video: two headings, both followed by some text, one empty line and then the line separator. In the first case the line separator is still visible, in the second case the line will be folded as well. My understanding is #1 is the bug and #2 is the correct way.
However I would strongly make the argument that #1 is the much nicer behavior. It makes more sense and it looks far better. If you decided to put a division line between two headings, the line shouldn’t be part of one heading, it should be something living between the two areas.
Would it be possible to fix it this way? As always: thank you for your great work!