It's more complicated, as the same code works when engine is set explicitely to gpg2 but the gpg1 engine return a no error data.