In my case I still needed to allowing Ctrl+Z (and Ctrl+Y) when the text inputs are focused:
Utilizing the same strategy as Martin's answer, we can get rid of the chrome behavior of refocusing a previously focused element when there is no focus (the body is focused).
window.addEventListener("keydown", e =>
{
if (e.target == document.body && e.ctrlKey && (e.key == "z" || e.key == "y"))
{
e.preventDefault();
}
});
Firefox doesn't seem to have this same behavior so it definitely doesn't seem to be an OS behavior.
Hopefully this is still relevant to you, or can be useful to others searching in the future!