A trait doesn’t have to be advantageous to persist just non-detrimental.
and not even that, I'd narrow it further to not detrimental before and during the prime reproductive periods of a species. After that period, detrimental traits are totally fair game and more dependent on technology, culture, and family care dynamics. Heart disease later in life caused by genetic predisposition to high cholesterol isn't something people generally select for or against in a partner, but its effects happen later in life well after people have children so it passes on.
They can be detrimental too, especially if they're linked to beneficial traits. The test is ultimately whether or not the harm done is sufficiently disadvantageous that it interferes with reproductive fitness. Baldness is arguably detrimental, but it's linked to a bunch of recessive genes that function in other ways, and it doesn't impact us until we're likely to have already reproduced.
That's a simplification, but you get the idea.
It is detrimental though. It is socially impolite to yawn in public.
Edit: why am I being downvoted for this?
Yeah that's (to me) a more accurate framing, also evolution is bad at revisions so even if there are minor disadvantages to a setup so long as it's not affecting your ability to have and raise kids it's basically completely absent as far as evolution is concerned. For example there are some wild inefficiencies in body layout left over from fish body patterns where the nerve from the brain to the voice box wraps down around your aortic arch because the relative position of the throat, brain, and heart were very different in fish so the path it took then was more direct. It happens in humans and most hilariously in giraffes where it goes all the day down their enormous necks.