Style of communication matters. There are different modes of interaction and being a caregiver/care-receiver is one of them that doesn't mix well with being desired sexually. You can, however, switch between modes. This is in fact the basis behind the therapeutic approach of Transactional Analysis:
Personally I've encountered the thing you've described, and think where it went wrong was falling into a persistent parent/child dynamic instead of returning to an adult/adult one. I'm a bit wiser now and can confirm that once you recognise the modes you're falling into, you can shed the (toxic) ideas like "nice guys finish last" and start having deeper relationships.
https://en.m.wikipedia.org/wiki/Transactional_analysis
Personally I've encountered the thing you've described, and think where it went wrong was falling into a persistent parent/child dynamic instead of returning to an adult/adult one. I'm a bit wiser now and can confirm that once you recognise the modes you're falling into, you can shed the (toxic) ideas like "nice guys finish last" and start having deeper relationships.