Fix issue in erasing nodes on corners LPE when only 2 segments
here all refactor bundled to test: !6232
fixes #4795