which shows that the failure to procreate relative to the levirate obligation, was not the only issue or even the main issue. If that were "it," both Judah and his youngest son Shelah would be liable to death, since they also did not fulfill the obligation with her. (Of course, until Tamar tricked Judah into it.)
But non-fulfillment of the levitate obligation in the OT did not incur the death penalty. It incurred a public shaming at the city gates. That was all.
What Onan did went beyond that: it deeply angered the LORD because it was a perverse act: going through the motions of intercourse while frustrating the natural fertility of the act.
The Song of Solomon is great. And, though it doesn't mention procreation, at no point does it disable or sabotage procreation.
My name is not Onan. I’m good.