Pyres it was dangerous, but many brilliant military maneuvers are dangerous if they were performed incorrectly. From Scipio's point of view the risk was worth it. He was facing men who were tired and hungry, and had been forced to stand in formation for hours while the skirmishers did their bit. In addition, the troops he had making the maneuvers were his best soldiers, against the weaker forces of the Carthuginians. This maneuver let Scipio put his legionairres up against soldiers who were barely trained, while making it impossible for the best Carthiginian forces to engage the Romans. Against some commanders this maneuver might well have gotten his army slaughtered, but Scipio correctly surmised his opponent's weaknesses and was able to execute the plan.
It's not like Scipio had much to go off of to assume that Hasdrubal and Mago would
not attack him during this maneuver. If anything, Mago had a history of being aggressive-he launched the ambush at Trebia. And I should also mention Hasdrubal Gisgo and Mago were the leaders of the army that ambushed and crushed the elder Scipios in Spain. If anything, their prior history (and the fact that they were eager to meet Scipio in battle) should have led Scipio to believe that they would not just sit there while he maneuvered around them. the troops were hungry and tired, but then again, so were the Roman troops at Trebia and they dove right into the fight.
And I would note that many of the best commanders were facing far less capable people. Hannibal's victory at Trebia and Cannae would have failed miserably against more able leaders. Similar stories can be told of Caesar, Napoleon, Gustavus Adolphus, etc.
The difference is that Scipio was usually facing inferior armies in quality that were of roughly equal size to his own (with the exception of Zama). Hannibal was facing armies superior to him in number, and at least early on, superior to him in martial ability (as demonstrated by the Romans' ability to break through the center at both Trebia and Trasimene). The same goes for Alexander (well, not necessarily quality wise, but the Persian cavalry was certainly equal in quality to their Makedonian counterparts). Alexander as well showed himself to be a master of sieges.
As for Caesar, I don't rank him up close to Alexander anyway, but again, he made the best of bad situations on many occasions, whereas Scipio seemed to have good situations to start with. The siege of Alesia, and his victory in the civil war are testament to this (on numerous occasions he was in a tight spot that seemed insurmountable).
At this point however the last two Roman lines were still largely intact despite the fighting and could likely have gone into the fray in case of a Carthiginian advance while,the Riman forces reorganized. In addition, according to Polybius the battlefield was (naturally) covered in blood and bodies which could have disrupted an advance made by Hannibal's own men (and would have done significantly more to disrupt his own advance than the Romans given the inferior training of the Carthiginian troops. Furthermore, advancing in this manner as the Roman flanks are being strengthened by their better soldiers could well have left Hannibal's forces to be outflanked by said soldiers.hannibal had to incorporate the first two of his lines into his own soldiers to avoid this.
Since the retreating soldiers had regrouped to the flanks mostly by this point anyway, I don't think outflanking was much of a worry for Hannibal at this point-at least not a serious one that should have prevented him from moving forward. First and foremost time was limited-he needed to win the infantry battle before Massinissa's cavalry returned. Second, the benefits of hitting the Roman army while they reformed may have outweighed the costs of possibly losing formation and being outflanked-he might have been able to sow enough chaos in the Roman ranks to get the upper hand in the infantry engagement early on. It wasn't a lot to go on, but Hannibal needed to do something to win before the cavalry returned. An infantry stalemate just wasn't going to cut it.
It should be noted that had the cavalry not pursued the Carthiginians the battle would likely have ended faster, and had they not returned as quickly as possible Hannibal may well have won the infantry battle that developed with his superior numbers.
Yes, but the thing was, the cavalry was going to return-Hannibal knew this, and Scipio knew this. Hannibal had to do what he could to win before the cavalry returned.
Either way, Zama was not a victory due to Scipio's genius, but due to Masinissa arriving in the knick of time.