As reported by @antondaubert:
On a debug build with _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY enabled from 100 executions around 80 are failing.
More details in https://reviews.llvm.org/D125776#3820399
The issue is related to the use of std::sort.