Fixes #4391: proxy ids are being sorted before the assertion