Parallel
Genesis 38:10
King James Version (1769 Blayney revision, with Apocrypha) · Berean Standard Bible
And the thing which he did displeased the Lord: wherefore he slew him also.
What he did was wicked in the sight of the LORD, so He put Onan to death as well.