Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
If you are unable to bend your right leg in prayer, there is no objection that you pray in the way that suits your body. You may, for instance, stretch out your leg in front of you or behind you or in anyway that suits your body. Allah Says (interpretation of meaning): {"Allah burdens not a person beyond his scope. }[2:286].
Al Bukhari reported that the Prophet (Sallallahu Alaihi wa Sallam) said to Imran Ibn Husain: "Pray standing and if you can’t do so, then pray sitting. And if you cannot, then pray on one of your sides".
Allah knows best.