This is a known bug with Android 12. In my case also sometimes only the launcher showed as “recent app” and nothing else and sometimes the button did not work at all.
According this thread in Reddit a possible workaround may be to enable the developer options and then set the “Animator duration scale” to “Animation off”. At least for me it seems to work so far. My theory is, that the recent apps will be shown using an animation and that animation sometimes crashes. By disabling animations completely, this can not happen any longer. Maybe you also need to restart device once or change from 3-button-navigation to gestures and back to 3-button-navigation once, so the recent apps button works again. But after that it should keep working with the animations turned off.
What is a bit worrying here - the bug seems to be known for at least one year(!). How can it be, that it is still not fixed?