It's really what everyone is attracted to. The Erykah Badu factor.
A person who knows what they want and has the courage to go after it. A person who seemingly is unapologetically themselves and despite what others think and gives you the courage to do and be what you want.
The problem is when people see the surface level facade of the bad boy/rebel and feels that that means s/he is authentic and courageous. When it can mean that that person is hiding pain, hurt, trauma, lack of trust, lack of respect for self and others.
Then comes in the healer/savior complex where people want to

for the bad boy/girl and show them another way and soften their edges til they lose the very spark of what made them attractive in the first place.