The stock recovery will look for a valid signature from its manufacturer.
What signature does TWRP look for? Does it have a built in keychain of known developers? Does it just check for any signature and accepts it regardless of the signer to check for integrity only? Does it check whether the signature is from the same signer as the currently installed ROM?
(I'm asking because LineagOS recently started releasing signed builds but TWRP failed to verify it. Probably you'll want to use the LineagOS OS recovery but those haven't been released yet)