I had a somewhat related follow-up.

In looking into this question, I came across A'raf 172. How does that fit into this discussion? Was this a time where we were tested before we were born and then given distinctions? I read into Allamah Tabatabai's 'Mizan' on this verse and it ended up confirming that Imamate and Prophethood were chosen in that world as part of our covenant. Can you explain this verse further please?

Yes this is known as Aalam Aldhar.
We were tested before this world.
Narrations tell us the Prophets and Imams responded before us acknowledging God’s oneness etc.