Thank you for the answer, it helped a lot! Previously I tried to solve it with precomposing the layers, but apperently I messed up the workflow. I followed your instructions, and here is how I made it work: Create shape layer -> Check 3D layer -> Precompose -> Check 3D on precomp -> Add effect(s)-> Uncheck Collapse transformations -> Works like a charm.
I will try that expression too, because I like to work directly with shapes instead of precomposing everything. Thanks again, saved me a lot of time.