So
his formation is just fine, with 4 defenders, 3 mdf., 2 wingers and one ST.Anyways shivam that is not bug.
Your formation was not suitable.
That also happen when you take less than 4 attacker in other pitch.
There is a small bug sometimes, when the program/game stuck and still "reading" some previous formation or an injured/booked player.
If you click the refresh button, it will be ok.