Automated hazard detection and avoidance remains a difficult and obviously not fully solved problem. The sole hazard detection and avoidance technique used with the Apollo mission was to have a human land the spacecraft.
Assuming almost all of the propellant on the descent stage had been used, the Apollo lander would have massed 2034 kg (dry weight of the descent stage) + 2445 kg (dry weight of the ascent stage) + 2376 kg (propellant mass of the ascent stage) = 6855 kg. At $1.62\,\text{m}/\text{s}^2$ (the gravitational acceleration on the surface of the Moon), that would have meant lifting over 11 kilonewtons (2500 pounds-force). Two people in balky spacesuits would not have been able to do that by themselves; they would have needed equipment that was not part of the manifest.
Besides, a tipover would probably have broken at least one lander leg, and Murphy's Law being what it is, would probably have tipped over so that the hatch was down.
Did the Apollo mission have a contingency plan for the lander tipping over?
Yes, they did. One of the many contingency plans was how to handle a tipover event. Uprighting the vehicle was not an option. The solution instead was to abort the landing. Unlike Intuitive Machine's vehicle, the Apollo missions were designed to return the crew to Earth. In the event of a tipover, the ascent vehicle would (with human intervention) have quickly separated from the descent vehicle and ascended. The initiation accommodated 1.4 seconds for pilot reaction time plus staging time delay plus thrust build-up time.