In all sysroots until alma10 (cos6, cos7, alma8, alma9) we had the symlink $SYSROOT/usr/lib64 -> $SYSROOT/lib64, but in alma10 it was changed to $SYSROOT/lib64 -> $SYSROOT/usr/lib64. See https://itsfoss.gitlab.io/post/understanding-the-linux--usr-merge/
However which_package does not know about symlinks and fails to detect files.