This is actually related to how the points for the lines are connecting and forming shapes.
Each software has a different way. PenPot does the same as Figma, connecting multiple lines to one point.
Plus there are some glitches in PenPot at the intersection, depending by angle.
Adobe Illustrator does it differently by creating 2 separate shapes even if you try to draw them connected.
Ideally the connections should still work like in PenPot but to be able to fill separately each closed shape. Would be great if there would be a way or a tool like a Bucket in Photoshop to fill up these closed shapes individually and not adding one fill color to the whole shape as PenPot/Figma does now.
This is very useful in illustrations when you have shadows or layers of slightly different shades on objects.