Maybe, though I suspect there are probably a lot of laws around what you can and cannot do so better get several good lawyers to check what the laws really are around this. Drug treatment programs often work like this so that is the first place to look for laws to watch out for.
I've heard of other attempts at things like this. Generally you are not locked into a cell, you are removed to a very remote location by bus so that if you want to leave you have to go through a formal withdrawal process - while waiting for the bus - during which they convince you to stay). They then not only control your diet they also give you exercise (often lead by military drill instructors) thus being a healthier environment than a diet cell. I have no idea how much money they make.
But even if the people will be confined, you have to be careful to take a broad enough population. I can expect people willing to participate in such study maybe are already orthorexic diet freaks? Or very poor people (which have a diet deviated from “mean”)
Doing studies with humans ist just hard!
Can't we just use literal prisoners?
That's what I always thought about the kind of research RFK Jr is always talking about. Normally it's not ethical to do food / medicine trials with prisoners, but these would be trials like giving regular food to one set of prisoners and food without dyes or chemicals to the other. The "test group" would just be getting healthier food.
Seems like just radically measuring portion sizes might fit into the same kind of thing. And you could probably measure activity level more easily, too.