Incorrectly ordered middleware can stop the middleware working as intended.
The order of middleware affections the outcome.
Some middleware should be near the end of the middleware list to ensure it is one of the last to be called.
For example RedirectFallbackMiddleware and FlatpageFallbackMiddleware should be near the end.
If our GitHub code review bot spots this issue in your pull request it gives this advice: