It actually still works to this day. Doubleclick the top left menu button (the one with the app icon) and your window closes.
Well, the standard window title bar still does. But with so many apps implementing their own borders, it's a bit of a crapshoot if it (or the window menu itself) will work with many apps. Even Microsoft apps sometimes forget, like Teams (of course...).
This doesn't work on some newer apps, like W11 Calculator.
Only in win32 applications. When UWP and its successors arrived, the OS stopped providing that functionality. Some applications may still support it, but the automatic equivalence of double clicking the application icon to the close button was removed, because the application is mostly tasked with drawing these UI controls now.