I had the exact same problem.
It appeared after updating macOS Big Sur 11.6 to Monterey 12.2
I have a MacBook Pro 13" 2017 (4 usb)
I was sure from the beginning that it was a software error. And I wasn't going to pay Apple for their mistakes.
None of the advice on this and other forums helped me.
Then I did the following:
Booted in safe mode (via Shift)
made a full copy to Flash drive
Rebooted into recovery mode
opened disk utility
and wiped absolutely everything - all the partitions on the drive
rebooted again
booted into internet recovery
installed macOS 10.13 High Sierra
and the Touch Bar worked.
Then I upgraded to macOS Monterey
and the Touch Bar still worked.
Then I restored all my data from the copy and rebooted a few times
Touch Bar continued to work fine.
But I decided not to stop there. I installed Boot Camp. Now everything was just fine. I'm zen.
I decided that my time was more valuable. And I don't plan on fixing the bugs that Apple makes.
I've been googling a lot to find a solution to this problem. And I'm surprised at how many people have been misled by Apple experts on forums and in service centers.
All of these people have paid a lot of money for programmer mistakes and unqualified customer service.
They don't even want to admit that they screwed up once again.