Car financing with low pension legal?

Hello, a friend bought a car from a car dealership chain. He gets around 920€ early pension and can’t handle money at all. Now his old car has broken and he thought he could buy a new one at the car dealership. There he was offered a Hyndai i20 for around 21000€. The rate is 230€. The car seller looked at the financial situation and the loan was granted. A month later my friend realized that he couldn’t afford it. He wanted to return the car, which would only have been possible for a fee of 4000€. Now I wonder if all this is legal at all. I mean, any person who can handle money will immediately realize that this financing cannot work.