Title::getWikiId() (code) is implemented as:
public function getWikiId() { return self::LOCAL; }
Which is incorrect if the title is an interwiki link. The docblock notes:
@note The behavior of this method if considered undefined for interwiki links. * At the moment, this method always returns false. But this may change in the future.
This violates the contract of WikiAwareEntity::getWikiId, and should be changed. If that's not currently possible, better would be to throw an exception if the Title is an interwiki, so the LSP violation would be more explicit and there'd be no risk of random malfunctioning if something relies on getWikiId() (perhaps because it's typehinting against a base interface like PageReference, and not Title).
It seems to me that the correct implementation would have to copy that of Title::getTransWikiID(). I should note that the method is not guaranteed to work because the iw_wikiid is not mandatory even for other wikis in the same wikifarm, but this has nothing to do with Title. I also don't know if there's another way to get a wiki ID from an interwiki prefix.