Where is the focus when cmd-z doesn't work?
Maybe the commands aren't being directed where you think they are. Or, it is not being "passed through" to the underlying web applet. The commands are sent to Safari, but you have a web applet running inside Safari where you think those commands should go. I don't know what Safari would need to undo, but if it thinks it has something to undo it may not pass the command on to the applet running inside the browser window.
Also, all of my experience with Goolag Docs, sheets, etc., is the interface is extremely wonky. I spend as little time there as I possibly can stand because of frustration--maybe it is better, now. It may be that it isn't processing what is being handed off from the browser.
Have you tried a different browser. I keep FireFox around for websites that don't work well with Safari. I also will pull up Microsoft Edge if I think I need a chromium rendering engine. Maybe Edge would work better as the web apps may be more tuned for chromium over WebKit. FireFox uses Gecko, so that pretty much covers the gamut of the main rendering engines in the rare occasion something on the web just doesn't work correctly.