Clicking on app in the dock takes me to another opened app
I am on a Macbook M3 Pro, fully updated to Sonoma 14.6.1
Sometimes when I click on an app on the dock that is open, instead of taking me to that app, it takes me to another app that is also open. When I click on the app icon again a second time, it finally takes me to the app I wanted.
This only happens sometimes, it can happen with any app, and I've noticed it usually happens when I haven't changed apps in a while. As soon as it happens once it won't happen again until later.
MacBook Pro 14″, macOS 14.6