Hernández signed with the Kansas City Royals as an international free agent on July 19, 2016, for a $15,000 signing bonus.[1] He spent his professional debut season of 2017 with the Burlington Royals, pitching to a 1–4 win–loss record with a 5.49 earned run average (ERA) and 62 strikeouts over 62+1⁄3 innings. He spent the 2018 season with the Lexington Legends, going 6–5 with a 3.29 ERA and 82 strikeouts over 79+1⁄3 innings.[2][3] Hernández suffered a stress fracture in his rib cage during spring training in 2019, and did not make his season debut until June 21.[2][4] He split the 2019 season between the AZL Royals, Burlington, and Lexington, going a combined 3–5 with a 5.31 ERA and 68 strikeouts over 57+2⁄3 innings.[1][5][6]
Hernández was added to the Royals 40–man roster following the 2019 season.[7]
On September 1, 2020, Hernández was promoted to the major leagues for the first time and made his debut that day against the Cleveland Indians, pitching 3+2⁄3 scoreless innings. With the 2020 Kansas City Royals, Hernández appeared in five games, compiling an 0–1 record with a 4.91 ERA and 13 strikeouts in 14+2⁄3 innings pitched.[8] In 2021, he compiled a 6–2 record with 3.68 ERA and 74 strikeouts in 85+2⁄3 innings.