A child can have a really high intelligence, but its usage will be compromised if they're always hungry, always sleepy from being saddled with taking care of siblings or afraid of being abused. A child can have lower intelligence but this can be buttressed by spending lots of extra time and tutors which the upper classes have in abundance.
One of the teachers I knew used to have a wag saying: "When you do wrong when you're poor, you get called thick and can look forward to jail. When you do wrong when you're rich, you get forcibly tutored until you're not an embarassment. When you do wrong when you're middle class, you get called ADHD so everybody can ignore you."
The way I see this is - intelligence is genetically determined, but success is determined by behavior, not intelligence. Intelligence just enables more adaptive behavior selection, all else being equal. Environmental factors can inject behavior patterns that override whatever analytic potential a person has. Which I think basically lines up with what you are saying.
For sure across an entire lifespan and within our society, what you do with it has a huge influence. And, intelligence often works against you since the more intelligent you are the more alienated you are from a larger percent of the population and this can cause a lot of psychological issues that work against “productivity” and “success”.
But for young kids I’m pretty sure intelligence and school performance are very correlated, much more so than peak income and intelligence for example. Schmoozing ability doesn’t get you far on a long division test.