It’s trivial for companies to avoid complying.
Meta don’t, for instance. They sell their quest headsets throughout Europe, but offer no warranty or support in many European countries in which they sell them, which is illegal under the EU CRD.
I foolishly bought one, knowing the risk - and it stopped working after a week, and that’s the end of the story - they refused to do a return or exchange, said I could ship it at my own expense, which I tried, only for them to “lose” the inbound package. They received it from the courier, mislaid it - my problem. They then kindly offered to ship a replacement controller at my expense (€150), but only to a different country, not to where I live. They then “lost” that too, forcing me to do a chargeback to get my money back, as despite having no proof of delivery to me, they insisted it had been.
As to “take them to court” - they know damned well that it’s not worth it to spend €10,000+ on legal fees over a €500 piece of electronics, which is why they knowingly and willingly act illegally.
The EU needs a simple, pan-European way to deal with bad actors, or it’s just meaningless legislation that provides no protection to consumers.