I think the red guy is a male...
Personally, I'd get three separate 5-10 gallon tanks. Keep them all in their tanks, separately.
It's super risky and difficult to have a sorority of female bettas - even experienced fish keepers struggle to maintain them, because this ISN'T how bettas live in the wild. They don't share territory, males OR females, once grown.
I hate that the betta sorority trend took off. The only reason people do it, is because usually the
young females won't attack their
siblings, since they've hatched from eggs and grown together in the same area. But once they reach maturity, they leave that area. They don't have that fighting/territorial instinct when immature, and they're all from the same batch, so if you get a bunch of sister female bettas while young, you technically can keep them together, and they're less likely to fight.
But sororities rarely ever work. Haven't heard of one that's lasted more than a year, because by then, the fish are fully matured and adult, and that instinct to be solitary and leave to search for mates has kicked in. They fight for dominance, often kill each other, or a lower ranked female is picked on and so stressed that they die.
This isn't how bettas are supposed to live, and you're forcing them to live in an un-natural way that leads to incredible stress, fighting, and even more issues like this when one turns out to be a male!
Bettas are called fighting fish for a reason. They've evolved to be solitary. It's natural for fry born in the same batch to not have the urge to fight their siblings since they all need to mature before venturing off to find their own way. But if you introduced an unrelated fish? It would be attacked. If you separate young females or males from the same batch while growing, then re-introduce them, they will fight. They lose that "hey, don't beat up your brothers and sisters" instinct once the other fish becomes a stranger.
As the young, wild batch of fry mature, they sort out a pecking order, and begin to get that urge to leave their hatching place, and to be territorial/defensive. They don't stay together for life.
Males leave to find their own patch of territory, and fiercely defend it. In contrast to popular opinion, bettas don't live in tiny puddles. They live in huge interconnected waterways, often with very large territories.
Females are solo travellers. They move around the waterways and find males that are acceptable to them. Once a pair mate, as you've seen, the male defends the bubble nest and drives the female away. He doesn't want any other fish near his eggs; that's his instinct, how they've evolved to survive in their environment. In a tank, the female has nowhere to escape to! Hence her ragged fins, and the fish you've lost/the one that's hiding. The male will kill another fish if he can't drive it away.
In the wild, the females would be driven away, so no need to fight. They leave and carry on their solo travels, finding food and other males to mate with. They don't live together in sororities, or establish their own girl gangs.
You committed to these fish, so personally I would get individual betta tanks for them. Minimum of 2.5g -5g, not those silly little "betta trio" shared water decoration things that only give the fish a half gallon of water.
If this is your first time keeping fish, I'm sorry that it turned out to be so rough! I don't mean to sound critical of you personally. It just makes me sad/mad that so many people promote betta sororities as easy and do-able, and post pretty photos, and too many beginners up in your shoes as a result
If you can't do the individual tanks, then please set up a quarantine temp tank for the male, or keep him in the breeder net for now, and find him a good home rather than returning him to the store. I'm sure someone close to you would be willing to take him! Gumtree has been useful for me for that, since you can talk to the person and find out if he'd be going to a suitable home, rather than just returning him. Then hopefully your two remaining female bettas can manage living together in your current tank.