For my testing, it was always on a brand new launch of the machine after shutting down. I put the CGDirectDisplayCopyCurrentMetalDevice() on a button press, so it was definitely checking after the device was assigned to the CAMetalLayer and had already rendered frames to it.
As for the question about other Metal apps running that would prevent it, this is why I would test on a new launch of the machine in each OS, with no other applications running. And by using the simple "Using Metal to Draw a View's Contents" app on both OS's it was very easy to tell that what was working in Catalina, is not working on Big Sur, since the amount of code is much smaller to check. You can very easily add a menu item or button on screen to check CGDirectDisplayCopyCurrentMetalDevice() and confirm that on Catalina it switches to the Discrete GPU but on Big Sur it does not.
Since I can’t attach files here, I attached to the feedback ticket the demo app where I added a menu item to the main app menu named “Check Display GPU” and it prints out the description of the GPU coming from the main display. On Catalina, after it runs it tells me the display is now being driven by the Discrete GPU. On Big Sur, it still says the Intel. Both fresh launches of the OS on the same machine, no other applications running.
The fact that the display will update to the discrete GPU on Big Sur if I run an app using Open GL (for example the default Chess.app) seems to confirm that there isn't another app running preventing the switching from occurring. You can run my demo on a fresh launch of Big Sur, see that the menu prints out the description of the Intel GPU to console. Then launch the Chess.app and once that is launched, the menu on the demo app will print out the description of the Discrete GPU. Close the Chess.app and then check the menu button again with the demo app, and it prints out the description of the Intel GPU cause it went back. Even though the app is set to use the Discrete GPU using the api and should be keeping the display in that state. Hopefully this can help show what's wrong.