tl;dr: There's a bit to reflect upon (playfully) but skip to the last sentence for the "bottom line" (figuratively and literally).
Let's assume that each 1 dollar of such "investment" of taxpayer dollars reaps $2.30 in GDP growth.
In the United States, in 2022 (according to some brief internet research that I will simply assume to be correct only for purposes of this thought experiment) the overall tax-to-GDP ratio in the United States was 27.7 % That equates, of course, to a decimal fraction of 0.277 -- but let's be generous and round that to 0.3, for ease of calculation.
Therefore, the government will get back from that $2.30, by way of taxation, 0.3 x 2.30, which is about 69 cents.
So for every such dollar spent, the national debt will increase by 31 cents rather than by 1.00 (since 1.00 minus 0.69 = 0.31). But it will still increase.
If we don't wish to keep increasing the national debt beyond the tens of trillions it already is (or is that just a silly concern?), we apparently will have to raises taxes so as to tax each such additionally generated dollar of GDP by more than 27.7 percent.
Perhaps, instead, to reach 1 / 2.30 = 43.478 percent!
That way, the 1.00 expenditure would create, in resulting additional tax, 0.43478 x 2.30 = 1.00 (rounded to the nearest penny), so that the national debt would not increase.
Assuming a current tax percent of 27.7 and a new tax percent of 43.5 percent (rounding to a tenth), we'd have to increase tax rates on those additionally generated dollars to 43.5 / 27.7 = about 157 percent of what those rates are now.
But, of course, increasing taxation might, in and of itself, have the effect of dampening the economy and retarding GDP growth somewhat. Unfortunately, the economy is a clockwork of feedback loops that are often hard to anticipate with precision.
But let's not worry about what might go wrong! Let's raise taxes by 57 percent and thereby make sure each of those additionally generated dollars of GDP are captured and fully taxed to the extent necessary to make sure that, like doctors, they first do no harm!
Of course, I'm partly kidding, or .... am I? Is Noflaps a horrible old Sophist, pulling the collective leg, at least in part? Or is he a righteous defender of the national "lock box" -- where (we were once told) social security funds should be kept.
Somewhere out there, some clever or at least diligent person might end up thinking: wait, Noflaps is rather wrong, I can feel it! He's missing something! Will that excellent person be able to slog through this lengthy diatribe, and then quickly identify as mistaken, and then clearly correct and refine, some of my musings?
I sincerely look forward to reading such a refinement! It's fun to read the wise responses of others, as this lovely forum so often permits! Chess players, after all, are excellent human beings, typically. And sound mathematical reasoning is always to be promoted and cherished.
HOWEVER, if we ARE going to deficit-spend (which seems to be becoming rather dangerous), I quite agree with
@bfchessguy (apparently) that spending on early childhood programs is one of the very best ways to do it, especially since kids aren't responsible for the deficit mess we've made so far.