As it turns out, the set of legal title characters is somewhat smaller after a File: prefix. See T196480 for an example from mediawiki.Title.js.
We should take into account $wgIllegalFileChars -- since that's not exported in siteinfo, and ideally will not remain a configurable option (T297340), we can just hard code the value and ban colon, forward slash, and backslash.
See T343047 for the same bug filed against the npm mediawiki-title package.