app-specific touch bar settings do not show after switching apps

BTT 3.170, Macbook Pro 15" 2019, MacOS 10.14.6

I've created a simple custom Touchbar for XCode. If works fine until I switch from XCode to another window - when I am back to XCode it shows the standard controls, not my. To make my ones appear again, I need to press on of the modifier keys.

UPDATE: just pressing the "fn" button makes my custom controls disappear - replaced by F buttons when fn is pressed and then by the standard controls when fn is released.

What I am doing wrong?

This is a bit old, but I figured it’s best to add my two bits instead of creating a new thread. I’ve had this issue off and on for a long time, but I’ve only just now tracked down something interesting: if I command tab to an app, the app-specific settings don’t seem to work but ONLY if the app I switched FROM is in a certain list.

Right now, this seems to be primarily apps that I know use web views (Safari, Slack, VS Code), whereas when I command-tab from other apps (Things, Terminal, iTerm, Mail) things seem to be fine.

I don’t know if the web view thing is important or just incidental, as it doesn’t seem to make much sense. But I consistently have the problem when switching to Terminal or iTerm from that list of apps, and not the others listed.