Wait, really? So if you have two copies of the same game, one bought from Steam and the other from Epic Store, Steam Controller will only work for the Steam one?

Just add the launcher to steam, and you can set the input profile for the game just fine.

Better yet if you use Heroic instead of the official Epic launcher, it will let you add the game directly to Steam.

This is basically how people use 3rd party games on the steam deck. You want them added to steam as 3rd party games for easy access in game mode, so you just add any non-steam games to steam. Heroic and other launchers make it pretty effortless, but you can do it manually as well.

You can add any executable to Steam, not only the games they sell, as far as I know.

The controller will work with Steam running in the background

It's a bit more complicated than that (on Windows) because Steam doesn't make a virtual gamepad to the OS. The way Steam handles the input is by hooking into the games individually. So to use Steam for other games, you need to add them to Steam as non-steam games.

Even open source controller remapping tools (not just Steam Controller) and similar used ViGEmBus which is no longer maintained. You can have it do mouse/keyboard though, those don't require custom drivers.