There were definitely periods with a Beis Hamikdash, but no king, such as with some of the Chashmona’im.
I checked in the Shabtai Rambam index on Hilchos Chagigah chapter 3. Apparently, the Minchas Chinuch and Rabbi Yerucham Perla (Mitzvas Asei 17) discuss the question. I don’t have these books here now.