You absolutely can automate GUI applications. The Mac had AppleScript and the Amiga had ARexx back in the late 1980s. Even iOS, which a lot of people think of as very obstinately non-scriptable/customizable, can automate a surprising amount of stuff using Shortcuts. What you need, as cle mentioned in another reply, is a way to decouple the data and core operations from presentation -- to wit, for applications to provide AppleScript "dictionaries," ARexx "ports," Shortcut "actions," or the like.
If you mean you can't automate a GUI entirely within a GUI paradigm, then you're closer to the truth, although Shortcuts -- and the third-party Mac utility Keyboard Maestro[1] -- are at least blurring the lines there.