A correct analysis answers two questions: what changed at the end, and what happened to the meaning?
● لَمْ نَذْهَبْ إِلَى السُّوقِ — first group: final sukun; “We did not go to the market.”
● لَمْ يَفْتَحُوا الْبَابَ — second group: added nun removed; “They did not open the door.”
● لَمْ تَجْلِسِي هُنَا — second group: added nun removed; “You did not sit here.”
All three express past negation, but their ending changes are not identical.