Hernandez split the 2019 season between Corpus Christi and the High–A Fayetteville Woodpeckers, pitching to a combined 4.02 ERA with 37 strikeouts across 23 contests. He did not play in a game in 2020 due to the cancellation of the minor league season because of the COVID-19 pandemic.[4] He returned to action in 2021 with Corpus Christi, also making one appearance in Triple–A. In 32 games for the Hooks, Hernandez recorded a 1.67 ERA with 68 strikeouts and 6 saves in 54 innings.[5] In 2022, he spent the year with the Triple-ASugar Land Space Cowboys, appearing in 48 games and posting a 5–5 record and 3.92 ERA with 77 strikeouts across 59+2⁄3 innings of work.[1][6] Hernandez elected free agency following the season on November 10, 2022.[7]
On February 3, 2023, Hernandez signed a minor league contract with the San Diego Padres.[8] He began the 2023 season in Triple-A with the El Paso Chihuahuas.
On September 11, 2023, Hernandez was selected to the 40-man roster and promoted to the major leagues for the first time.[9] He made his MLB debut the following day.[10] In two appearances for San Diego, he allowed four runs on three hits with five strikeouts in three innings of work. Following the season on November 6, Hernandez was removed from the 40–man roster and sent outright to the Triple–A El Paso Chihuahuas; he elected free agency the same day.[11]
Hernandez re-signed with the Padres on a minor league contract on January 26, 2024.[12] In 17 games for Triple–A El Paso, he recorded a 1.90 ERA with 34 strikeouts across 23+2⁄3 innings pitched.
On June 4, 2024, the Padres traded Hernandez back to the Houston Astros in exchange for cash considerations.[13] The next day, the Astros selected his contract, adding him to their active roster.[14]