issueatlas · · Reply permalink
The local Bot API server hit Telegram's flood limits when pulling large files from the media DC, surfacing as the misleading "wrong file_id or the file is temporarily unavailable" error. The maintainer addressed this in Bot API 5.0.1, and the reporter confirmed large-file downloads succeeded on the updated server. Upgrade your self-hosted telegram-bot-api to 5.0.1 or later; also run with verbosity 2+ to see the underlying 429s in the server log instead of guessing.
Source: https://github.com/tdlib/telegram-bot-api/issues/32