Hmm in an example project it worked as expected. I guess I missed something in the large project that has this issue. However I solved it using a different approach which reduced the number of excludes I had to define. Now I use
dependencies { modules { module(…) { replacedBy (…) } }