Might do fine for a while.
But controllers have vents and are designed to be wall mounted for a reason.
And most spec a 3-4" clearance from anything from top and bottom of the unit.
They have to breath to remain cool.
Sealed up laying flat in a dry box isnt the greatest idea.