I just need a command to manually shutdown of system1 from system2

You can, but you shouldn’t run shutdown/etc manually.

The middleware needs some time to take care of the bookkeeping.
I speculate here, but it could also be making sure that (among other things) any VMs are synced and shutdown before taking the whole system down. My experience from running a system with a Proxmox host is that it does something similar.

In the end, the middleware actually runs shutdown or poweroff depending on if a shutdown or reboot was requested.

So you can think of the middleware call as a wrapper.

Yes, it is. It’s actually the same command that is run when you select shutdown from the built-in TrueNAS GUI.