i feel like the anime doesn't do a good job of explaining the physical toil that sea-prism stone has on devil fruit eaters. The basically feel like they have zero energy and they lose all ability to control their powers. Their powers can still be forced to activate by some external factor, like during Arlong where Nojiko was able to stretch his neck underwater, but otherwise they can't use them. So Luffy would be able to stretch limited amount inside the cage, but once his arms or any part of his body got close to the sea-prism bars, he would lose all ability to control his stretching, which is why Smoker doesn't just turn to smoke and leave