Wikipedia said:When he was 18, Frederick plotted to flee to England with Hans Hermann von Katte and other junior army officers. While the royal retinue was near Mannheim in the Electorate of the Palatinate, Robert Keith, Peter's brother, had an attack of conscience when the conspirators were preparing to escape and begged Frederick William for forgiveness on 5 August 1730;[11] Frederick and Katte were subsequently arrested and imprisoned in Küstrin. Because they were army officers who had tried to flee Prussia for Great Britain, Frederick William leveled an accusation of treason against the pair. The king threatened the crown prince with the death penalty, then considered forcing Frederick to renounce the succession in favour of his brother, Augustus William, although either option would have been difficult to justify to the Imperial Diet of the Holy Roman Empire.[12] The king forced Frederick to watch the decapitation of his confidant Katte at Küstrin on 6 November, leaving the crown prince to faint away and suffer hallucinations for the following two days.[13]
Wikipedia said:After the prince attempted to flee to England with his tutor, Hans Hermann von Katte, the father had Katte executed before the eyes of the prince, who himself was court-martialled.[4] The court declared itself not competent in this case. Whether it was the king's intention to have his son executed as well (as Voltaire claims) is not clear.
Okay so basically Frederick attempted to escape to England, but was caught. Because by running away Frederick had deserted the Prussian army his father court-martialled him, but the court claimed itself not competent enough to perform the trial. Some claimed that Frederick father wanted to execute him (punishment for desertion).
So what if Frederick the Great had been executed?