Or meeting Apollo in space or an old earth ship holding some 72 genetically engineered criminals from the late 20th century or meeting a race of dinosaurs from earth on the other side of the galaxy.
Our heroes never were illogically surprised by these events. They did not fail to take note of early signs blatantly indicating what was to come. So these incidents have nothing in common with either the example I gave, or the case of Starfleet failing to note that Data looks like Soong.
Data had been active for more than a quarter century by the time of Datalore, I'm sure Starfleet knew alot about Data
Well, Spock had been in Starfleet for a long time before we learned his fellow Starfleet officers knew next to nothing about Vulcans - no idea of mind melds, of pon farr, of the seven-year mate-finding cycle, or that Ambassador Sarek is Spock's father (and the father of Spock's half-brother)! Perhaps Starfleet knew about those things, but chose not to tell Kirk, McCoy or other Enterprise
officers for reason X... And perhaps Data was kept as an enigma for the same reason X. But that sounds like a pretty ridiculous thing to do.