The shortcut never matches, because eventCode is the code property of the KeyboardEvent, which identifies a physical key by its position in the US layout and not by the letter printed on your keyboard. On a German keyboard Y and Z are swapped against that layout. Therefore the key printed Z reports KeyY, while KeyCode.CODE_Z is KeyZ, which is the key printed Y. See Key Combination.
This also explains why stopIfUnavailable: true stays silent. The flag is evaluated only after a shortcut has matched and the modelled action turned out to be hidden or disabled, so a shortcut with a non matching eventCode produces no toast in any case.
You can confirm it in the browser console before changing anything:
document.addEventListener("keydown", (e) => console.log(e.code, e.altKey), true);
Pressing Alt and the key printed Z logs KeyY. Use that code:
keyCombinations: [{ modifierKeys: [KeyboardShortcut.ModifierKey.Alt], eventCode: KeyCode.CODE_Y }]
If your users work with different keyboard layouts, list one entry per physical key, because keyCombinations is an array:
keyCombinations: [
{ modifierKeys: [KeyboardShortcut.ModifierKey.Alt], eventCode: KeyCode.CODE_Y },
{ modifierKeys: [KeyboardShortcut.ModifierKey.Alt], eventCode: KeyCode.CODE_Z }
]
The label is not derived from the layout either, so "Alt + Z" is shown to every user regardless of the keyboard they use. I have reported the documentation gap, because the section warns about Digit4 versus Numpad4 and about the left and right modifier keys, but not about layouts, which is the case that hits a German project first.
Bug ticket was filed.