I answered a similar question over on Stack Overflow, around the time I was still working mostly in High Sierra. Testing it today, it still works on Catalina.
Here's the salient part of that answer:
tell application id "com.apple.systemevents" to set the value of ¬
attribute "AXMinimized" of every window of every process ¬
to true
The reason your code doesn't work is because miniaturised
is not a property of the window
object belonging to the processes suite of System Events' AppleScript dictionary. It is a property of window
objects belonging to the standard suite of any scriptable application's AppleScript dictionary (including SystemEvents, although it doesn't have any windows of its own); despite sharing a common name, these two window
class objects are distinct and unrelated objects in AppleScript.