I don't agree with the catholic interpretation of the Onan story anyway (although I am pro-Catholic: I just don't think they get every detail correct).
Genesis 39 was about Potiphar’s wife and what she did to Joseph when he refused her advances. The Genesis 39 accusation doesn’t have to be all about sex but it has to do with a pattern of accusation many women know how to engage in when they sense that the social stars are in their favor when they wish to do a male harm!