You are mixing and matching your facts, and Somalia is a particularly bad example of ignorance of causing weapon systems to perform very sub-optimally. There were a number of problems with the weapons and ammo as used in Somalia i.e. there were a number of things that I guess you could call gross violations of "best practices for optimal ballistics". That is neither here nor there, and I could spend a lot of time writing about the bad judgement used regarding a number of things that made the weapons underperform when it mattered.
"AP" is a misnomer for small arms ammunition because you can't punch any armor with it that you couldn't punch without it. In fact, the only people that call it AP are us plebes and the people who try to sell it to us. The military doesn't make that claim for M855. In fact, they have a different designation for the real AP 5.56 (and this "real" AP was used in Somalia). However, it is true that in current military loadings, an "AP" 7.62 will out-penetrate the 5.56. Unfortunately, in field situations you'll likely be stuck with M855 5.56 and standard 7.62 ball. Of those two, the M855 penetrates better. Remember also, that the old steel tip .30-06 (aka "black tip") was not a proper AP bullet either, and was specifically designed to increase what had been observed to be the poor penetration capability of the standard lead core ball ammo used for the .30-06. Adding a steel tip to the lead core .30 caliber bullet was the direct consequence of observed deficiencies of the standard .30-06 bullets in combat conditions when it came to penetration through walls, masonry, and similar. All lead core bullets suffer this problem when breaching "hard" targets. The current lead core 7.62 is a repeat of that problem. Ironically, it was the Belgians who developed the SS109 bullet in 5.56mm to solve the same problem. Apparently the military establishment was a bit slow to learn from their own history, as we had already addressed the exact same issue not that many years prior during the war.
Backing up though, one could question the wisdom of trying to shoot through a mud hut. A rifle is the wrong tool for that job with any type of bullet. Even if you managed to shoot through it, the terminal ballistics would suck.