Hello Sitifan, when the phone went dead is an adverbial clause of time. Such clauses normally can be placed either at the beginning or at the end of the sentence. In your example, the adverbial clause is obligatory at the end because it represents climactic information in narrative - it gives the more important information and aims to provide an emphatic climax.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.