Why clock skew breaks TOTP first
The only inputs are the secret, the 30-second time counter and HMAC (SHA-1 by default). Client and server agree only if they slice time the same way, so a device 30 seconds off produces codes that never validate. When “the code is always wrong”, check automatic time sync before anything else, then server NTP.