Foreign nationals who have lived in the UK for years are being driven to despair by a government scheme aimed at guaranteeing their rights after Brexit.