I see two issues here.
The plant looks like it's leaning towards the window. They grow towards the light. If you can, put a plant light directly overhead. That should help straighten it up.
Also, it's not the soil that holds the plant up. It's the roots. I suspect your roots are shallow and weak. When you repot, think about gardening for the roots.
Start with a pot with lots of drainage. Use a cactus potting mix with added grit. When you water, water thoroughly until the soil is wet and water runs out the bottom. Then let it get quite dry before watering again, this may be two weeks or more. Roots follow the water, but not into soggy soil.
The trick is to get the roots to grow to the bottom of the pot, that will hold the plant more upright and improve its overall health.