MacOS allows apps to minimize their windows and yet the app itself remains visible as the Menu Bar. My guess is that the app you are trying to activate had all its windows minimized before the app was switched for another app, and that's why it remains in that state after you switch back.
This is the behaviour of macOS, which isn't KM's fault, but fortunately you have KM, so you can change the behaviour by creating macros with the right triggers. The following page seems to address how to resolve this, at least for "Finder".
I'm trying to figure out if there's a way to make this work for all apps, not just Finder. Like you, I find this feature of macOS to be annoying.
There are some important ideas on the following page that might also help you. Check out the shortcuts on this page.
https://wiki.keyboardmaestro.com/manual/Application_Switcher
It appears to me that I have a solution that works for all apps. My solution will activate ONE window, not all of them. You didn't say if you wanted all the windows open or just one. Try out my solution and see if it's good enough. It relies on the fact that most applications have a Windows menu item. If the app doesn't have that, this macro may produce an error.
