Huge comment that noone will read, especially not while reading the method where it is being used.

Can we come up with a proper method name instead? You are not sorting them but arranging them in order, like solving dependencies.

ReorderHandlersGivenDependencies() ?