Exclusive: Guardian Australia obtains legal letter that appears to cast doubt on some of the state’s key justifications