They could have passed a law to shut down USAID, that would have been the proper, legal way to do this. They didn't. The executive legally can't do whatever they want, but the Republicans in the legislative simply stood by and cheered while the administration trampled over their legislative responsibilities and powers.
As I understand it, under the "unitary executive theory" the executive can legally do whatever it wants.
And to be clear, they couldn't have passed that law because doing so would be extremely unpopular. I.e. they would not have been able to gain the required support for their actions.
It’s more complicated than that. You have to read the specific statutes in question to see what they require or don’t require.
The USAID-related litigation has largely been unsuccessful because the appropriations bills don’t necessarily require USAID to do particular programs. Most of the appropriations bills appropriate money for the State department.