Deprivation of liberty safeguards are 'deeply flawed'