After some years in French service von Paykull returned to Saxony where he eventually became Lieutenant General around 1700. He was part of the Saxonian army that tried to stop the Swedish Crossing of the Daugava in 1701. He was injured during this fight and left the service for some years, but returned in 1704 to command a cavalry regiment.
In 1705, von Paykull was captured by the Swedes at the Battle of Warsaw. He was brought to Stockholm where he was executed on 4 February 1707 for high treason due to his service for Saxony, though being born in a Swedish province. Known as an alchemist, he tried to escape execution by promising annual deliverance of gold to king Charles XII of Sweden but was rebuffed.