Thanks for pointing me towards this issue. Fix: https://gitlab.nic.cz/knot/knot-resolver/-/merge_requests/1774
All versions are affected (checked recent 5.x and 6.x). We'll fix this in all future releases (5.x + 6.x).
--Vladimir