"The Emperor planned the heresy on purpose" was stupid when Goulding tried to push it into canon, and it still is now.
Then the Emperor is a raging idiot. He knew about Chaos and yet let Lorgar act, indeed he let him get away with killing Custodes. He knew about the Fleshchange and the Thousand Sons personal daemons and yet he let them practice sorcerery without comment. He knew about the opinions of the Fabricator General and yet he never acted to secure Mars. He knew about Angron's
issues and yet never acted to prevent his inevitable betrayal. He knew about the Nighthaunter and yet did nothing to solve the problem.
He conquered a galaxy for the stated goal of unifying humanity and ending religion, and yet his conquest was done with nothing more than a cursory attempt at building the organs needed to sustain an interstellar government and with forces littered with religious symbolism.
Would the Emperor have been happy if the Heresy never occurred, the Imperial Webway succeeded, and Magus took his place on the Golden Throne? Sure. But did he actually seriously plan for any of that to happen? Not if you go by his actions in the whole of the Horus Heresy series.
The Emperor is a man who has been active for more than forty thousand years, and throughout that time he has been conqueror, statesmen, scientist, philosopher, general, and bureaucrat.
Everything the Emperor was personally involved in, everything related to the Imperial Household, was conducted in the utmost of secrecy and without paying even lip service to honor or morality. The legion that he most personally shaped was the First, the legion known best for its opacity, its eschewing of honor, and its layered deceptions and plots.
The Emperor engineered, used, and then destroyed the Thunder Warriors without a qualm. The Space Marines were explicitly designed to be cheap, mass producible, and disposable shock troops to win him the galaxy.
This was a man who practiced secrecy more instinctively than most men breath, whose right hand and most trusted was also the Emperor's personal assassin, an assassin who would personally shape (and run) the entire Adeptus Terra for the explicit purpose not of governing humanity but of purging it of religion and advancing the Emperor's goals. A right hand who would personally found and control EVERY imperial intelligence agency; the first Inquisitor, the first Master of Assassins, the chief spy. Malcador was a man who despite all his power, able to stand toe to toe with Primarchs in open combat, almost pathologically concealed that power and acted as a frail old bureaucrat.
This was the Emperor whose personal guards were created not as an army but as spies, assassins, and as his most trusted operatives.
This was the Emperor who was soul bonded to every single Astropath in the galaxy, who was the most powerful psyker extant, who constantly lied to the galaxy as a whole and his "sons".
And this is supposed to be the man who totally missed a rebellion forming against him at the behest of his primary enemy? Who was totally unprepared for and blindsided by the Heresy? To the point that he didn't even have any contingency plans? And yet was suddenly able to create both the Inquisition and Grey Knights and have Titan thrown into a time dilation warp bubble while the Sol system was occupied and under siege and without his enemies even noticing what he was up to?
Again, either the Emperor was an idiot of the highest order or he allowed the Heresy to occur for his own purposes. Because the only way for him to miss the Heresy forming is if he was a raging idiot, and if he realized it was coming then he could have stopped it at any point up until Istvan essentially at will and with little more than a handful of orders. And that ignores that the primarchs were kidnapped as newborns by chaos and not destroyed at the time.
EDIT:
And lets get into the outcome of the Heresy. The Imperium was left in largely uncontested control of the galaxy, the power of Mars was substantially reduced, and the Astartes have been purged of the untrustworthy. And later? Thanks to the Sisters of Battle getting shown to the Golden Throne we know that the Emperor approves of his being worshipped (at least post Heresy).
For ten thousand years the Emperor has been the sole focus of worship for more than 99% of humanity. Every one of those countless quadrillions is born, lives, and dies praying daily to the God Emperor and dedicated themselves to him. For ten thousand years a thousand psykers per day have been fed to the God Emperor; that is the sacrifice of 3.65
billion psyker souls to the God Emperor. 40k lore is replete with example after example of what even a handful of sacrifices can do. Where is all that faith and all those souls going? Not to Chaos, it is dedicated to the God Emperor and he is anathema to Chaos (and the belief structure of the Imperial Creed explicitly rejects Chaos).
Ten thousand years of dedicated faith. Thanks to the Eldar and Slaanesh we know how to produce a warp deity in 40k, and it is almost exactly what humanity has been doing with the Emperor for ten millennia. Which puts that whole Heresy thing in a very different light.
A force built to conquer but not to rule, nor to think. A force lead by generals who might be of peerless capability but are all emotionally and mentally crippled and unable to look past their own biases or engage in honest self analysis. A force dedicated to eradicating religion from humanity and purging every non-human population from the galaxy, and one that is conveniently neutralized once its task is done. A force whose actions seem purpose engineered to invoke religious imagery and ensure the worship of the Emperor.
It very much is either "the emperor is an idiot" or "the whole of the great crusade was engineered for far different purposes that what anyone outside the innermost council of the Emperor would even contemplate for an instant".