The main mistake of the so called german leadership was to plan for a quick war only. The second main failure was to led their soldiers down as the winter came. The third the political loudmouth game between Stalin and Hitler. The russians made what the americans did in the cold war. They entrapped the Germans in an economy race. That as introduction and reminder. So if the Pz-IV was mass produced or not isn´t the actual question. In fact it was first thought to re-fit the Pz-III because he was seen as the better main battle tank. The Pz-IV in its origins was a support tank. He should add firepower against soft targets. He wasn´t thought of as main battle tank. Why he became it nevertheless? Because his turret and chassis were able to carry the 75mm long barrelled gun. The Pz-III wasn´t able to do so.
Now to the actual question. The Pz-IV was a fine tank. Contrary to the movies after war he was feared as well so far as I know. But that is only hearsay from relatives of veterans. Nevertheless he was an expensive tank seen by time produce, material and price. Not only that the capacities of Germany were fully used to capacity. A further problem was to get iron/steel. If the neutral Sweden wouldn´t have been with its iron/steel sendings Germany would never have had get started the way it did. So Germany had to fall back on quality products to level out the greater production rate of Russia - it didn´t have the opportunity for mass production in allied scale. America was no part in that considerations since one hoped to get allied with America or at least establish a military neutrality. So the "new" Pz-IV should be able to destroy the feared T-34 on "long" distance so the canon of the T-34 wouldn´t have a good chance to hit and/or kill. That he did bravely.
Since the production rate of Germany was fully used to capacity the manufacturers promised better tanks. They couldn´t raise the mass - and even the quality. So better tanks had to become heavier if You wanted a better armor. They had to become heavier since stronger/bigger guns were implemented and even the mechanics for the turrets were heavier and so on and so forth. Now the planning for the war came into play again. Blitzkrieg! The war should already have ended before a longer time. No raising of output possible, facilities and factories not built underground, the allied air superiority came into play... So material got more and more expensive. And the heavier tanks? Were even more expensive in every aspect. But they were needed since the T-34 wasn´t the only threat anymore. IS-2, Firefly, ISUs and SUs, Sherman and Churchill variants were all able to kill the Pz-IV. This added with the restricted mass production capacity negated the sense of the Pz-IV mass production. That was the "hour of birth" for the E-series where many parts were shared with the other platforms of this series.
So my answer is clear NO! Germany shouldn´t have invested in mass production of Pz-IV. They should have earlier get started thoughts about the E-Series or similar. And they should have went a bit further yet and use that procedure for producing planes. And they should have started a strenuous effort to get the most important facilities and factories and civil shelters underground. That thoughts came only a bit too late. Otherwise, who knows, maybe that would have been the bit of time to change the tactis and develop the needed technique.
But all this was nullified as the Americans changed the war - Little Boy and Fat Man. Mass production and so on - obsolete.
Greetings