I have heard it said that the two Seals weren’t assigned there but came to help defend the consulate. If that is the case, and there was only supposed to be Stevens and two others (one escaped through a window, I understand), then the betrayal of encountering opposition may have played a part in the death of Stevens.
Stevens was dead (or at least trapped and unconscious) in the residence of the main compound two or three hours before the former SEALs were killed at the second “annex” compound.