I think this 引き返す is a case of zero-nominalization (discussed here: Zero-nominalisation - Why and When?).
This means that it works, against all appearances, as a noun phrase, and is part of the familiar construction "NP + と + なる" ("become NP").
Hence "引き返すとなったとたん" more or less equals "as soon as [it] became that [I'm] going back". (I'm trying to come up with a natural translation in context but keep drawing a blank.)
Whereas the parallel of "it became time to go back" would be "引き返す時に/となった".