It is also important to fix the rocking for sewer gases could be making their way into the room and this is something that shouldn’t be breathed by anyone. Sometimes 2 wax rings need to be used instead of just one, making sure to place the wax rings on the bottom of the toilet first, then pressing down the toilet to the floor.
When the toilet is fixed and reset, and the toilet is not rocking out at night anymore then, a thin silicone caulk should be used around the base to prevent further sewer gases from being omitted into the room. Some plumbers and some states have different codes for this, some seal completely around the base, some leave an opening in the back to allow to see for anything leaking and some do not use a caulking at all.
Whatever you decide to do the most important thing is to make sure the toilet sits firmly and completely flush to the floor without any movement .