You have two jobs as a parent: create a safe environment for your children and prepare them for the adult world that is wildly unsafe. Unfortunately, these two goals are both required and contradictory. A line must be walked. Too much deviation to one side or the other will cause severe problems.
That line cannot be prescribed. It's different for each child, but there's a big problem with how you put your point. You aren't trying to prepare the child for a dangerous and difficult world, you are trying to protect them in a different way, minimizing the other dangers. I completely understand. It hurts to see your child hurt. All you want to do is make the pain go away.
Instead of helping them avoid the pain of learning about relationships, you should guide them. Help them understand. They won't at first. Like a toddler throwing a tantrum that you won't let them stick objects in wall outlets, parents have to be the "bad guy" from time to time. Eventually, the toddler will grow up enough so that you can explain dangers to them and you won't have to do it for that thing anymore. The same applies here. They won't understand at first. Help them understand the dangers. When they do, you can teach them how to safely use the metaphorical wall outlet. Then you don't have to be the bad guy anymore.
The outcome? Really shitty social skills until I hit 27 or so. My dad really regreted what it did, and my mom become aware on how utterly shitty was to let a nerdy kid disconnected from their peers.