As @arkord commented on their own question, the auto-collapse is not coming from VS 2022, but rather from the CodeMaid extension. However they cited the incorrect settings.
- In Visual Studio, from the menu bar, select "Extensions" - "CodeMaid" - "Options..."
- Then select the "Collapsing" section
- Uncheck both the options for:
- Collapse solutions when they are opened
- If there is only one project in a solution, keep it expanded but still collapse its children
- Select the Save button
Now when opening your solutions in Visual Studio 2022, they should not auto-collapse, instead returning to where you last left off.