I cannot say I know what happened,a squib is one possibility.I would expect you would find a ring in the barrel if it was a squib load.
Another possibility would be a slam fire.
A good primer to use is the CCI Mil-Spec.It is designed for the AR's needs.These days,folks are desperate for any primer.Some are a bit too sensitive.He may have loaded high primers,not fully seated.You may have some crud in your bolt that stuck a firing pin forward.
A slam fire can occur as the bolt is fully forward,but the bolt carrier and cam have not rotated the bolt to locked.
It is important to try to solve the mystery of root cause,and correct your process.To do less is to invite a repeat.
You may stop shooting your buddy;s reloads...good plan,but if he is standing next to you when his rifle blows up,.....It still stops being funny
Scrap the original bolt.If the receiver extension cracked,I would not trust the bolt.I would at least get a new cam pin.Agreed,if the receiver ext cracked,the barrel may have expanded.
It doesn't take a special person to build a complete upper,but it does take competence.OP,no disrespect to you at all,but reading your post,you aren't ready to be a builder.Learn more first.
Keep it safe!!Good luck.