In ziarat of Lady Fatimah, we read that she underwent a trial before she came into this world. Does this points to our existence too as spirits before we are brought into the wombs of our mothers?

Yes everyone was tested before this world, and those who succeeded were chosen to be God’s representatives