I use Google Assistant on my S21 5G and the microphone icon in the keyboard options used to work well for speach-to-text purposes until I updated to Android 12 today. Since the update, when I tap the microphone icon, the keyboard disappears and I'm left with a an empty text box and no way to add input. When I go to the keyboard settings under General management the default keyboard shows as "Google Voice Typing [Legacy]" instead of "Samsung Keyboard." Once I change it back, the keyboard reappears. Also, at this point, my only 2 keyboard options are the two mentioned above.
I'm not sure which of these steps fixed my issue, but I started by disabling "Google Voice Typing [Legacy]" keyboard in my "Keyboard list and default" settings menu. Then I uninstalled Google Assistant, disabled my "Google" app, and restarted my phone. After the reboot, the "Google Voice Typing" option showed up in my "Keyboard list and default" settings menu without the "[Legacy]" annotation. Now with this new keyboard enabled, when my Samsung Keyboard is open I can tap the keyboard icon in the lower right corner and change the input to Google Voice Typing for speech-to-text.
I hope this helps someone else who has this same issue. Also, after I got this working, I re-enabled my "Google" app and re-installed the "Google Assistant" app and I now have the Legacy keyboard option available again, but I left it disabled.