Foi sorte ele ter passado por isso.

English Translation

It was lucky he went through that.

não seria “he had gone through this” em vez de “he went through this”?