el expression in jsp:invoke-Collection of common programming errors

Technically the fragment attribute is not a rtexprvalue, which can be seen from the schema; which means It’s evaluated at compile time.

There is really only a very limited set of use cases for what you’re trying to achieve. Most likely you want to supply multiple fragments to a tag file and let some conditional decide which tag to output.