Gangland criminals could walk free due to legal loophole