Looks like this issue has been fixed in the last few versions of Angular.
Here is an example of Angular Material components working inside a component with encapsulation
set to ShadowDom
:
And if you need the contents of cdkOverlay, modals, etc to be inside the shadow dom, here is a proof of concept doing that: