A guard checks that a third-party object has one method, then the code calls three others. A stand-in that has only the first throws on the next call, and the cleanup after it never runs.
Put cleanup after a try, not at the end of the happy path. Any throw above it skips it.
Guard on what you call, not on one sample. A partial object passes a one-method check.
Guard on what you call, not on one sample. A partial object passes a one-method check.