My kitchen panty doors are coming of the track.
One roller has come completely off the track.
Have no personal experience with this, but did a Google search "repair bi-fold doors" and lots of sites to help you repair the doors are out there including videos.
Mine was falling off a top track vs side. I simply bought a new track and it fixed the problem inexpensively. You may simply need a new side wheel if it is bent. You could possibly straighten the pin to the wheel it out.
Mine has a metal bracket-[inside door, next to wall]. There is a screw that needs to be tightened. Push the door back where it belongs first, getting roller back in the track then tighten the screw.
Go to youtube, several videos to show you the type of bi-fold you may have and how to repair it and what if any replacement parts you need. You can order parts on Amazon. I am 76 years old and after fighting with 2 separate doors for 3 years I went on you-tube, watched the appropriate video, ordered my parts and was able to repair both doors in less than 20 minutes.
The piece sticking out at the end needs to be inserted in the sliding clip
Here is a great video to fix bifold doors and put back on track