Thanks so much for posting this issue and solution.
I had exactly the same issue with courses imported from a 2.3 to a2.5 site. All the 'Unenrol inactive after' dates were set to 'Never' and setting them to 1800 days then gets self-enrollment working again. So it looks like just changing the setting will then "correct" the issue.
This is obviously a bug in the way that setting is restored and so it appears that the Unenroll inactive dates are passed for everyone.
I restored this course with existing users in it. That may be an interesting variable.