Hello Pss,
Thank you for using Apple Support Communities. Based on your post, you've had issues with the Mail window opening once minimized when you select on the Mail app in the Dock.
Currently, we're using Big Sur and had no issues selecting on the Mail app to open the Mail Viewer Window. If your Mac isn't doing this, then we'd recommend to remove the app's saved state and test it out. You can do this by quitting the Mail app, then holding the Shift key when you launch it again. Release the key once it opens completely. Minimize it to the Dock and select on the Mail app icon to see if it opens the Mail Viewer properly for you again.
If it persists, then we'd recommend testing out safe mode. This prevents some processes from running and will help to isolate it further. Our link here explains how to boot to safe mode and what to do if the issue does and does not happen there: How to use safe mode on your Mac
Tell us how it went in safe mode and we'll continue to help out.
Wishing you the best, take care!