I think Stevens’ death was an accident.
There was a well-prepared assault on the “CIA annex” (which wasn’t annexed to anything), to reduce it and remove the contents of the “warehouse”. The events at the “consulate” (which wasn’t a consulate) were a diversion to draw off defensive forces from the main target, which succeeded.
They did not expect Woods and Doherty to put up a fight at the “consulate”. This escalated things to the point that the building burned, with Stevens locked in a very unsafe safe room, where he died of smoke inhalation.
The purpose of the operation had zero to do with Stevens, and everything to do with the “warehouse”, which was stripped to the walls.
Perhaps, timing seems very wrong though, I still think there is something else going on.
No.
The initial attack was on the safe house (a "consulate" can issue passports and visas, safe houses can not). Ansar Al-Sharia knew Stevens was there.
Hours later, with no fighting on-going at the safe house, Ansar Al-Sharia attacked the CIA station.
The timing rules out the "diversion" theory.
Ansar Al-Sharia knew Stevens was there, and they waited for the Turkish Ambassador to leave.
Stephens died after being raped, sodomized and tortured.