Yep. Democracy is two wolves and a sheep voting on what's for dinner.
(while this is much fun...)
It's 51% of people telling the other 49% what to do.
By definition, this is
not democracy.
Democracy implies you have a constitution which exists exactly to prevent this problem.
If some so-called democracy does what you describe, it is not a democracy at all, i.e. it is either violating its own costitution, or has a fake useless constitution in the first place.
Constitutions are changed often based on a majority vote.