Fix debug assertions properly once and for all

[#72706522]