Try clicking multiple times very fast on the following button, and observe how the old content sometimes stays visible under the new content:
The more the DOM tree is complex, the more visible is the issue.
Try swapping the background-image with the value without a CSS variable (in style.css) to observe no issue, confirming that the issue is linked to CSS variables.