BTT incorrectly detects app for popup windows

this is not a bug, such windows do usually not change the active app. (this is intentional, they don’t want the other app to loose keyboard focus. Some of them have special modes to do that though )

However often you can use conditional activation groups in BTT to match such windows.
Have a look at the various options described in this thread: