To create shelvestet from set of files I use following command:
tf shelve /comment:myComment myShelveName /recursive /noprompt /replace /move "firstFile" "secondFile" ... "lastFile"
If all of the "firstFile, .. lastFile" are checked out then command succeeds - if any of them is not checked out then command fails.
Solution to avoid such failure is to checkout all the listed files regardless to whether they are changed or not. Another option would be to filter the names of the somehow. And you may find out more.
But, in general, is there some option to successfully use
tf shelve on set of files where only some of them are checked out?