The other wild card is temperature controlled fans... They may use the natural convection until the fan is needed. In that case, the thing may heat up faster than expected before the fan kicks in if horizontal, and life may be shorter.
Many VFDs can be used either vertically OR horizontally. If they go to the trouble of saying vertical only, there is probably a reason.
Use an enclosure that allows that.
BTW, if the VFD only fits one way, the enclosure is probably too small and does not meet the size and clearance requirements..
In an enclosure, the heat is first transferred to the air, then to the enclosure, and finally to the air external to the enclosure. That requires a certain minimum area of the enclosure surface. Normally that is a spec in the manual as well, although it may be expressed "indirectly" as a certain clearance all around the VFD.