My Betta was ok with Cardinals - it was the glass bloodfin tetras that killed them off! They basically chewed the tails off, disabling them, then all the other fish were eating them once they'd died. The bloodfins were killing 1 a day - evil fish. They didn't harm the neons surprisingly though! The cardinals and bloodfins were almost the same shape (more streamlined than the neons) - maybe they saw each other as competition.
The Neons, Cardinals and Bloodfin tetras never nipped my Betta.
I think i've learned not to diversify too much in the community tank - 9 platys of various colours, 6 glass bloodfin tetras, a betta and 4 sterbai corys.
Bettas attacking or being attacked probably has as much to do with the tank as the temperament of the fish - plenty of nooks and crannys needed, plant cover etc, somewhere to hide and explore.