If the link click that is being tracked is a navigational link (one that causes you to leave the current page and navigate to another), you may be seeing this issue because the current page is being unloaded at the same time that you are trying to execute some code.
Selecting `Delay Link Activation` on the rule's condition may give you the time you need to execute your actions before navigation takes place.
Beyond this, I would switch to sequential JS from non-sequential JS for the click action.
Also, assuming that you are loading the Global Site tag when the page loads, you should be able to call the `gtag` function directly from your sequential JS. You will not need to get gtag.js again since it should already be on the page.