The problem is while technically Jacobson v Massachusetts is supposed to declare unreasonable restrictions unconstitutional, in practice it has allowed forced vaccination, forced sterilization, and forced detention. Oops!
Sorry for not making the connection clear enough. You mentioned a “compelling interest”; this is the same logic that was decided in Jacobson v Massachusetts which is the foundation for US case law regarding this topic.
My point is that this does fall under that reasoning.