Because ERR_clear_error() is not run, any error like verification error lingers and propagates into the rest of the app.
I have a a Qt app that tries JWT verification with various keys in order (so always some failures), and I've had the weirdest socket errors being thrown by the Qt app, like error:0200008A:rsa routines::invalid padding. When I run ERR_clear_error() after all JWT operations, this is fixed.
BTW, for my app I made a small class that calls ERR_clear_error() in the constructor and destructor. This allows simple instantiation of that thing in any function to ensure the error is cleared, before and after the operation.