How to restore custom layout/panels when loading a blend file with different settings?
If this is happening on a file you didn't create, and want to preserve your own default layout, uncheck the LoadUI box when loading the file.