Judge orders release of refugee claimant jailed 'for no real reason'