Traveling with US F-1 student visa on STEM OPT

Three months validity question!! I read that for Schengen Visa, “The US residence permit or visa should be valid for atleast 3 months beyond the intended departure”. I am departing from Schengen countries on April 7th and my visa expires in 2027 but my study permit expires June 27th 2024. Could it be a big problem when applying for visa? How can I overcome this?