The EU has accused the UK of allowing companies to gain an illegal advantage but the European Court of Justice has sided with Brexit Britain.