To be fair if they didn't write that then forcing convicted persons to do any work as part of their rehabilitation would be illegal, for instance community service sentences. A constitution provides the bare minimum rights. The nitty gritty should be dealt with in higher level more mutable law. It's the complete dysfunction of the law making bodies that is the problem.
And what if they say "you can do community service or get 20 years in jail"? If you allow that kind of choice there's no difference to the status quo, it's just window dressing.
Constitutions are not the right place to put laws that need to updated.
That's part of the court setting the sentence though. There are already maximum times for imprisonment set in law, so I don't think your scenario is realistic.
If it's interpreted as permissible to threaten someone with prison if they don't do community service, then a constitutional prohibition of convicts being forced to work is nugatory. And if it's interpreted as impermissible then you just banned community service.