I think we have had this topic before on this forum. I recall that too large an 'inbox' causes the problem. Yes, a search using 'compacting' found 2 threads.
This one came up searching for 'Outlook Express'.
Here is the M$ solution to recovering the emails