Castillo signed with the Tampa Bay Rays as an international free agent on July 6, 2012. He spent under two seasons playing for Tampa Bay's minor league affiliates.[citation needed]
After the 2017 season, the Padres added Castillo to their 40-man roster to protect him from the Rule 5 draft.[2] Castillo was called up and made his major league debut on June 2, 2018, and pitched a 1-2-3 inning with 3 strikeouts that night, including strikeouts of Cincinnati Reds all-star sluggers Joey Votto and Eugenio Suarez. [3] He ended the season 3–3 with an ERA of 3.29 in 37 games. In 38+1⁄3 innings, he struck out 52 batters.
Castillo began the 2019 season on the 60-day injured list due to a left flexor strain. He only pitched in 2/3 of an inning for the Padres in 2019, allowing no runs and striking out two, before suffering an injury to his left middle finger and ending the season on the 60-day injured list. Due to the 2020 Major League Baseball season being shortened to 60 games because of the COVID-19 pandemic, Castillo ended up missing the entire season due to a left lat strain and a torn ligament in his hand.[4] On March 4, 2021, it was announced that Castillo would require Tommy John surgery after exiting a simulated game on March 2 because of forearm tightness.[5] On March 6, Castillo was placed on the 60-day injured list.[6]
On November 30, 2021, Castillo was non-tendered by the Padres, making him a free agent.[7] On January 14, 2022, Castillo re-signed with the Padres.[8] He had his contract selected on August 23, 2022. On November 18, Castillo signed a one-year contract with the Padres, avoiding arbitration.
Castillo began the 2023 season with the Triple–A El Paso Chihuahuas. In 22 contests for El Paso, he struggled to a 9.82 ERA with 22 strikeouts and 2 saves in 18+1⁄3 innings pitched. In his only appearance for San Diego, he only recorded one out while surrendering four runs on two hits and two walks with no strikeouts. On July 20, 2023, Castillo was designated for assignment following Robert Suárez's activation from the injured list.[9]
Miami Marlins
On July 25, 2023, Castillo was traded to the Miami Marlins in exchange for cash considerations.[10] On August 10, he was removed from the 40–man roster and sent outright to the Triple–A Jacksonville Jumbo Shrimp.[11] In 14 games for Jacksonville, he posted a 5.59 ERA with 26 strikeouts in 19+1⁄3 innings pitched. On October 5, Castillo elected free agency.[12]
Arizona Diamondbacks
On November 27, 2023, Castillo signed a minor league contract with the Arizona Diamondbacks.[13] He made 21 appearances for the Triple–A Reno Aces in 2024, compiling a 4.35 ERA with 21 strikeouts across 20+2⁄3 innings pitched. Castillo elected free agency following the season on November 4, 2024.[14]
On November 27, 2024, Castillo re–signed with the Diamondbacks on a new minor league contract.[15]