Don't use System Events to do this. As well as the difficulties you've discovered, it's also a pretty unreliable way to do this, a potential security risk, and—thankfully—not at all necessary.
Here's an outline of how to use Automator to insert the date at the cursor's location in the currently active application:
Create a new† Automator workflow, selecting Quick Action as the type. Enter the name you wish it to go by, but try and be sure because changing it later in this particular instance could be irksome.
When you're presented with the newly-created, blank workflow, there are options at the top that allow you to dictate what sort of input you can pass to the workflow, and in which applications the service will be available. Set these to the following:
The third option you need to select is this one:
This—as the name suggests (in a slightly misleading way)—causes the Quick Action to run as normal, and at the end of its run, the final result—assuming it can be represented as text—will replace the currently active text selection, much like when one pastes the contents of the clipboard into their document. If a text object permits highlighting of its text content, then it will always contain a text selection object, regardless of whether or anything text is highlighted. In this instance, i.e. most of the time, it is located wherever the cursor is, and contains zero characters.
Create a Run AppleScript action. Delete any default script text that it contains so you have a blank editing field, into which you can paste the following code:
tell ((current date) - (time to GMT)) as ¬
«class isot» as string to return the ¬
contents of [text 1 thru 10, space, ¬
text 12 thru -1] as text
This produces an formatted date and time derived from the ISO-8601 international standard, and looks like this:
"2020-07-26 14:21:11". It's basically the order that date and time parameters should have been dictated from the very start, but most countries unfortunately didn't think hard enough, and ended up with the year in third position, and the date and month in some arbitrary choice between the first two positions. How ridiculous.
Save. Quit. Assign a keyboard shortcut in System Preferences. Done∗. Here's the finished workflow:
∗(Almost done) Whilst the keyboard shortcut you set via System Preferences > Keyboard > Shortcuts > Services should work in all appropriate situations, it seems to be buggy in web page text entry fields. The menu option appears in the services menu, but without a shortcut seemingly assigned to trigger it. Therefore, create an additional shortcut via System Preferences > Keyboard > Shortcuts > App Shortcuts > All Applications and assign it the same hotkey as the other. Now it works.
†Usually, editing a workflow and saving it will effect the changes more-or-less immediately so that it works outside the Automator environment, as you'd expect. This isn't necessarily the case with the option to replace selected text, which can take quite some time or require a system reboot to work outside Automator. Therefore, two things I advise you get correct to help avoid starting all over again are: 1) The name you wish your Quick Action/Service to have; and **2)**That you check the box to allow output to replace selected text. If something doesn't work, delete it all and start again.