Its very non trivial because you could select instances that can't have the same styles/properties applied
Could you not skip elements that don't satisfy the criteria? Having mixed content preselected is common place in every app that supports multiselection.
In my first screenshot I have preselected two files. One file allows for the selected operation, the other one doesn't.The app silently discards the wrong file from the stack.
The second case (images 2,3) shows a mixed preselection inside a 3D app. Two of three items are valid input for an extrusion, the third one gets disregarded.
In the case of styling assignment if you wanted to be super accurate, you could output a toast: Skipped [item name] from Token assignment.