I suspect the original problem is with the quality of your boundary linestring. I see gaps in the polygon version (particularly the right corners), which suggests the linestring wasn't actually closed. The result looks like a common digitizing error where a polygon boundary crosses itself and so some areas are incorrectly interpreted as interior when they should be exterior.
Note this may occur (probably does) at new nodes, not necessarily input/existing nodes - it's not that it connected a node more than once, rather it followed the line to the end and then drew a straight line from the last connected node back to the begining node (or some variation on this depending on how the tool is written). That line may cross the boundary line in several places, and every place it does creates a new node. The resulting enclosed areas become polygons, but as mentioned above what is intended to be interior and exterior gets lost.
The first suggestion would be to go back to your original line boundary and clean it up - make sure all nodes connect and that it is in fact a closed line. Then rerun your Lines to Polygons tool.
If for whatever reason that isn't an option, there are several ways you could tackle the problem. Two would be:
- Digitize a whole new shape, using a trace tool to follow the 'real'
boundaries and ignore the 'shortcuts'.
- Use Polygon to Line and Multipart to Singlepart down as far as you can break things. Then you can either use a split line at vertex method or go in and manually split the 'shortcuts' in the middle and start removing extras with the Node tool. Finally fill in
the gaps of what is remaining so you have a continuous closed line and run Line to Polygon again.