This paper addresses the interplay between vacuum and thermal local averages for massless scalar radiation near a plane wall of a large cavity where the Dirichlet boundary condition is assumed to hold. The main result is that stable thermodynamic equilibrium is possible only if the curvature coupling parameter is restricted to a certain range. In more than three spacetime dimensions such a range contains the conformal coupling, but it does not contain the minimal coupling. Since this same range for possible values of the curvature coupling parameter also applies to massive scalar radiation, it may be relevant in settings where arbitrarily coupled scalar fields are present.