that seems to be a common shortcut for writing "genius" characters: character jumps to wild conclusions on scanty evidence and turns out to be right
it only works because the author is in complete control of the story world, and so gets to declare that the character is right in-universe, even if it makes no sense
another example that comes to mind is Artemis Fowl
@kellerfuchs I accept this name.
@magical @noiob Oh, yes, Artemis Fowl is definitely a case of that sort of “intellectual Mary Sue” (is that a good name for it?) but it can make sense if the character being a genius is an excuse for the actual plot and wild adventures (it's a fantasy book after all, though that's still kinda-lazy writing), as opposed to deductive investigation being the premise of the whole genre.