Yes you were lucky. Turn on obstacle avoidance. Bypass or brake, not off. That being said, I have found narrow things, poles, branches, small tree trunk (2”-3”) tree trunk, I have hit.
The only setting that works reasonably reliably is brake. As this will stop the drone from getting to close...