Weird. I renamed the test and extended it bit to have logging and be uniform in general, and now it passes (without your patch): https://salsa.debian.org/mariadb-team/mariadb-10.5/-/jobs/1748275
I was expecting that adding the new step in Salsa-CI would show failure, and then adding your patch would fix it. I'll try to switch from apt-get to apt and see if this problem occurs only with apt, but not apt-get.