You may remember that one of your fellow officially licensed authors - I don't recall whom and as I type this, I hope I'm actually misremembering myself - included a bizarre throwaway scene in an 80s or 90s novel. In essence, near the end of the story as I recall it, Spock privately admits to Kirk that while in some sort of alien-induced coma or sleep state that also included an astral projection component, he visited the quarters of some unnamed sleeping female crewmember as a phantom and engaged in telepathic sexual activity with her. The dialogue makes clear that it was really just a dream to the crewmember and would be remembered as nothing more than that. But Spock is horrified and tells Kirk about it. Kirk reacts with aplomb and nothing more happens.
The rest of the novel was pretty good, but I found the above scene - which I think was written by a woman, perhaps expressing a fantasy for the author or others - to be utterly gratuitous and completely distasteful (to say the least). It took me out of the story and I've never forgotten it, 30-35 years later. (Well, provided that I'm not misremembering it completely, that is!) I don't know how the editors approved it and I'm pretty sure it wouldn't make the final cut today.
However, it seems to jibe with what you describe above. Yuck.