Dear all, I think this is an issue with the Hardware token and not with the userland libraries and tools.
More specifically, I am able to reproduce this bug with Device type: YubiKey 4 Firmware version: 4.3.7 on a Gentoo system, whereas "reproduce.sh" succeeds with a newer Yubikey: Device type: YubiKey 5 NFC Firmware version: 5.4.3 Software and versions: openssl-1.1.1o yubico-piv-tool-2.3.0 Best, Matthias