Sheikh Salman al-Oadah
It is permissible to change one’s intention during the performance of prayer from an intention to offer an obligatory prayer to that of offering a voluntary prayer.
For instance, if someone starts to offer the obligatory Zuhr prayer then decides to change it to a voluntary prayer, he may do so.
It is also permissible to change one’s intention from an emphatic sunnah prayer (sunnah mu`akkadah) to a non-emphatic voluntary prayer. Therefore, a person can start off with the intention to offer the Witr prayer, and then change his intention to that of an ordinary voluntary prayer.
However, if a person starts praying with the intention of offering a voluntary prayer, he may not change it to one of offering an obligatory prayer. Likewise, he may not change his intention for offering an ordinary voluntary prayer to one of offering an emphatic sunnah prayer.
And Allah knows best.
Source: Islam Today