H1B visa extension - Indian passport expiry date

Do you know what the exact rule is regarding visa stamping if a passport is due to expire?
Appointment confirmation says : The passport must be valid for at least six months beyond the period of stay in the United States.

My India passport is valid until June 16 2024. My I797 approval (for a H1B visa) is valid until September 30 2026.

My wife’s India passport is valid until July 12 2025. Her I797 approval (on a separate H1B visa) is valid until July 31 2025.

Is this going to be an issue resulting in visa denial or does the embassy just grant a visa until passport expiration if validity is less than H1B validity?

Thanks so much for your help.

US Embassy should stamp the full term of the H1B visa irrespective of passport expiry.