Beset by bullpen issues and facing a dwindling supply of relievers with MLB’s Tuesday nonwaiver trade deadline fast approaching, the defending World Series champion Houston Astros on Monday pulled off a trade that carries a higher degree of risk than the typical prospect-for-veterans swap.

In acquiring closer Roberto Osuna from the Toronto Blue Jays — in exchange for Ken Giles, their own ousted closer, and two pitching prospects — the Astros, at least on paper, have solved their desperate need for lockdown, late-inning relief. But with Osuna, there are several additional layers of complexities involved.

Osuna, 23, is on baseball’s restricted list as a result of a 75-game suspension under MLB’s domestic violence policy. He is eligible for reinstatement Sunday, but his return is subject to other factors, including the outcome of a court hearing scheduled for Wednesday. If any new information emerges, the suspension could be extended.

Unlike players suspended for PED use — such as Seattle’s Robinson Cano this season — players facing disciplinary suspensions such as Osuna’s are eligible to be on their team’s postseason roster.

“The due diligence by our front office was unprecedented,” Astros General Manager Jeff Luhnow said in a statement announcing the deal. “We are confident that Osuna is remorseful, has willfully complied with all consequences related to his past behavior, has proactively engaged in counseling and will fully comply with our zero tolerance policy related to abuse of any kind. Roberto has some great examples of character in our existing clubhouse that we believe will help him as he and his family establish a fresh start.”

In the same statement, Osuna used phrases such as “fresh start,” “move forward” and “positive contribution,” and he concluded, “I thank Jeff Luhnow and the entire Astros organization for believing in me — I will not let them down.”

The move is reminiscent of the New York Yankees’ trade with the Cincinnati Reds for closer Aroldis Chapman before the 2016 season, when Chapman was set to serve a suspension for a domestic abuse incident. Osuna was placed on administrative leave May 8 following an arrest by Toronto police on suspicion of assaulting a woman.

For all their might and pedigree, the Astros were in a precarious spot roughly two-thirds of the way through the season. Though they held a four-game lead in the American League West entering Monday and were on pace for 101 wins, they were just third in the overall league standings, behind the Boston Red Sox and New York Yankees, and theoretically could need to go through both teams in October to return to the World Series — a task that would have been significantly more difficult with an unsettled late-inning relief picture.

Over the weekend, the Astros traded for setup man Ryan Pressly from the Minnesota Twins, but they still needed someone to pitch the ninth. Giles, the Astros’ primary closer in 2017 (until losing his job during the playoffs), was demoted to Class AAA on July 11 following a long bout of inconsistency coupled with a series of ugly (and public) meltdowns — including one in which he punched himself in the face as he walked from the mound to the dugout.

In addition to Giles, 27, the Blue Jays received minor league pitchers Hector Perez and David Paulino. Paulino, formerly the Astros’ fourth-rated prospect by MLB Pipeline, fell in the rankings after serving an 80-game PED suspension in 2017.

All other things being equal, Osuna was the perfect solution for the Astros’ late-inning relief issues. Not only is he brilliant on the mound, with a 2.93 ERA before his suspension, an all-star berth in 2017 and 104 career saves at such a young age, but he is also making just $5.3 million this season and is under club control through 2020.

But with Osuna, all things are far from equal. For starters, he hasn’t pitched in the majors since May 6. He is currently pitching on a minor league rehab assignment and is unscored upon in six appearances.

Perhaps as importantly, the Astros will have to convince their fan base to get behind a new closer in the midst of an ugly domestic violence case — one that is still open.

Every baseball trade is a gamble to some degree, but this one left the Astros vulnerable, even as it left their bullpen less so.

More baseball coverage from The Post: