A move by the British government to rip up post-Brexit trade arrangements in Northern Ireland is "illegal and unrealistic", the European Union's ambassador to the UK has warned.