H4 Visa Stamped with Previous I-797

I’m a H1B VISA holder worked for company XXXXX with i797 valid until September 2023. My spouse got his H4 VISA stamped(company XXXXX) until September 2023. Few months later I moved to a new company YYYY with i797 valid until mid 2025 and now travelled to India for vacation and my VISA stamped with YYYY until mid 2025.

Now I’m planning to return to US with my family. With this scenario can my spouse travel with me with his VISA stamped with my previous employer which is valid until September 2023?

Visa is not tied to any employer even if it has employer name on it. You can use your visa as far as it is valid on the day you enter the US.