I would say that Data's Theory of Mind is incomplete and was intentionally left so.
He was designed to be an aid to Dr. Soong, not to stand as a complete individual. As such, Data was not designed with a personality, nor was he given the ability to perceive and anticipate other human responses. These were not part of his core subroutines. Data is first and foremost a hyper-sophisticated piece of hardware and software programming.
As he began to evolve his program, he tapped into the heuristic algorithms that allowed him to continue to learn and engineered himself to be able to take on other personalities as he does in the holodeck. These subroutines had to be modified to work with his positronic brain, and likely did not exist before he created them (seeing as there were no other positronic brains that needed said programming before he did.)
Before the emotions chip, Data was unable to grasp basic emotion and
imagination, leading him to download personality subroutines into his
programming when participating in holographic recreational activities
(most notably during Dixon Hill and Sherlock Holmes holoprograms) and
during romantic encounters (most notably with Tasha Yar and Jenna
D'Sora). Yet none of those personalities are his own and are
immediately put away at the conclusion of their usefulness.
He would remove such sub-routines at the end of his sessions, the same way we would remove clothing designed for an event such as skiing. Useful for the entertainment but hindering otherwise.
The problem with Data and his development is that it was artificially inhibited by Dr. Soong. His cognitive abilities are a result of his programming, first and foremost. He does have a learning AI but before he integrates his emotion chip, he had reached the limits of his heuristic programming and could make no further leaps, as limited by the programming he received. He was designed to be limited, likely as a safeguard against his being perceived as "too human." He was designed to assist, not replace humanity. His ability to develop a Theory of Mind was likely not part of his original programming as that would be beyond the scope of his design.
In that regard, Dr. Soong failed. Despite all of his efforts to keep Data a cold, logical, efficient piece of machinery, his efforts to make his device, "user-friendly" would eventually lead it to developing a personality and eventually to mimic in every way imaginable the very humanity he sought to exceed.
I considered it strange Dr. Soong would develop the emotion chip but then I remember the Lal incident (Data attempts to recreate a positronic brain but imbues it with emotional capacity). Lal later dies (ceases to function) when fear overwhelms her. Perhaps Dr. Soong already know his design was incompatible with emotional input and the emotion chip is held outside of the main brain, isolating the emotion information required to function.
It can be assumed that later designs including the android Julianna Soong (incorporated an entire suite of emotion modules) which allowed her to appear perfectly human. Would that include a Theory of Mind. Perhaps. Or perhaps it simply created the illusion based on the programming subroutines similar to ones used by Data in the holodeck. For all intents and purposes, it would appear to a normal human to be the same thing.