I don't see how the macros makes this process any simpler... nor how it adds any value. The system usually works perfectly fine: turn on your TV or AppleTV, and the other device comes on as well. The problem occurs when you're trying to turn on the television by turning on a device that was not the last used device, and this one occurs regardless of what the device is.
I also have an LG television, and switch between a PlayStation 5 and an AppleTV. If everything is off and the AppleTV was the last device used, and I then turn on the PS5, everything turns on and then the television switches back to the AppleTV, forcing me to use the TV remote to change the input source back to the PS5. Similarly, if I turned off the television with the PS5 being the source, and then power everything up by turning on the AppleTV, it works fine for a second or two and then turns on and switches back to the PS5.
Given what's been written here, and since it cuts both ways regardless of which device was the last one used, I get the impression that this is an issue on LG's part.
I have two possible work-arounds, but unfortunately none of them make it work as you would hope:
1) If you know you're going to to be using a device different from what was last used, turn the television on, allow it to power up what it was previously connected to, and then turn on the other device. The television will appropriately change input sources. The downside to this is that you either need to allow the device you're not using to go to sleep on its own, or interact with it to power it down or put it into suspend.
Don't want to touch your TV remote? Here's another tip. Part of the reason I chose LG over Sony or Samsung was for HomeKit support. If you have Home set up (and if you have an AppleTV or a HomePod, you can set this up quite easily), you can turn your TV on and off with Siri commands. Unfortunately, Siri does not seem to be able to control the television beyond that.
2) Use a hardware switch (HDMI switch). My television has four HDMI ports, two of which support 4K at 120 Hz, and one of those two of which is unfortunately used for eARC. I bought a switch so that my PS5 and AppleTV could both use the higher refresh rate. You press a button and it toggles which device is connected. I haven't ended up using it beyond some initial testing; as I recall, it resolved this issue... but did require that you verify that the correct device is designated on the switch.
In response to an older comment from above, the setup for all of this was incredibly easy. It's just unfortunate there's no way to fine-tune it. It seems like there's a software update for the television every 1-3 months, so maybe LG will eventually fix this... but I'm not holding my breath for it.