In
https://github.com/flutter/flutter/pull/33164 I propose that we remove the
Layer.replaceWith method. This method is not used by the Flutter framework, and we lack tests for it. Therefore its behavior is undefined.
Please, don't hesitate to reply here if this method is important for you. We could reevaluate removing it, and add sufficient test coverage for it instead.