The clocks on both devices (i.e. fb's server and your phone) need to be fairly closely synchronised. TOTP effectively encrypts a timestamp using a shared secret then decrypts it on the other side and checks you're within some bound. If either clock is out it won't work.
TOTP generates the codes on both the client and server sides. The user enters the client generated code and the server validates it.
So if the time on the client device is wrong (perhaps it was manually set and not updated for daylight savings), then the server will disagree with what the code should be.
Sounds like that'd be on the FB infrastructure side though?