Answer
I say, and with God's help: One of the conditions of prayer is covering the 'awrah (nakedness): It is called 'awrah by the linguists due to the ugliness of its exposure and the need to lower one's gaze from it, and it is derived from 'awra, which means deficiency, flaw, and ugliness.
Those who study the expressions of our esteemed Hanafi jurists find that they do not consider tight clothing to be sufficient for covering the 'awrah in such a way that prayer is valid in it, or that it is permissible to look at it, even if it is from close relatives, as will come in the fatwa regarding a woman's wearing tight clothing in front of her mahrams; they have defined covering the 'awrah. The scholar al-Shurunbulali stated in his commentary on al-Durar 1: 60: "Covering means that what is beneath the cover is not seen, even if it describes it, it is not permissible, until it is required to cover." This was clarified by the researcher Ibn Najim in al-Bahr al-Ra'iq 1: 283: "If the 'awrah is covered with a thin garment that describes what is beneath it, it is not permissible, whether someone is present or not, even if he prays in a dark house while naked and has a pure garment, it is not permissible by consensus; because covering includes the right of God and the right of the servants, and although it is generally taken into account due to being concealed from them, the right of God Almighty is not like that. If it is said that covering does not conceal from God Almighty; because He sees the concealed as He sees the uncovered, it is answered that He sees the uncovered as one who is neglectful of etiquette, and the concealed as one who is adhering to etiquette, and this etiquette must be observed when one is able to do so."
These are explicit texts indicating that it is not permissible to pray in tight pants that describe the 'awrah of a woman. They mentioned that it is recommended for a woman to pray in three garments as an exaggeration in covering herself. The scholar al-Shalabi stated in his commentary on Tabyin al-Haqaiq 1: 164: "It is recommended for him to wear his best and most suitable garments during prayer and to wear a turban, and likewise when reciting the Quran, and to face the Qiblah with it. In al-Tuhfa and elsewhere, the types of clothing in prayer are three: recommended, permissible, and disliked.
The recommended: three garments: a shirt, a waist-wrapper, and a turban, as narrated by Abu Ja'far al-Hinduwani from our companions, and according to Muhammad, it is recommended to wear two garments: a waist-wrapper and a turban.
The permissible without dislike is to pray in one garment, wrapping it around oneself, or a tight shirt due to the presence of covering the 'awrah and the essence of adornment.
The disliked is to pray in trousers or a waist-wrapper alone.
For women, the recommended is three garments in all narrations: a waist-wrapper, a dress, and a headscarf. The evidence for the dislike of praying in trousers alone, while having a shirt, is the hadith of Abdullah ibn Yazid from his father, may God be pleased with him, who said: (The Messenger of God, peace be upon him, forbade praying in a blanket without wrapping oneself in it, and the other is to pray in trousers without a waist-wrapper)" in Sunan Abu Dawood 1: 228, and al-Mustadrak 379, and it was authenticated, Sunan al-Bayhaqi al-Kabir 2: 236.
As for our esteemed Shafi'i scholars, they disliked a woman praying in pants even if it was permissible. Imam al-Nawawi stated in al-Majmu' 3: 176: "If the color is covered and the size of the skin is described, such as the knee and the buttocks, the prayer is valid in it due to the presence of covering. Al-Darimi and the author of al-Bayan narrated a view that it is not valid if it describes the size, and this is an obvious mistake. It is sufficient to cover with all types of garments, skins, paper, woven grass, and other things that cover the color of the skin, and there is no disagreement in this."
In my commentaries on Qalyubi and Umayra 1: 202: "As for what describes the size without the color, such as tight trousers, it is disliked for women, and it is contrary to what is preferable for men, and there is a view that the prayer is invalid," and similar in the commentary of al-Bujayrimi 1: 452. And God knows best.