I've tried to make the pen cosmetic by setting the width to 0. That way the line should always have the same width on screen no matter the zoom factor. And the problem still occurs.
hello again @Goffer
I tried my test project on Windows and got the same results. It looks like we are stuck with that behaviour.
You could always submit it as a bug.