The overlap gap property and approximate message passing algorithms for $p$-spin models (The Annals of probability)