Repository: flutter
Issue: Painting a child of type RenderRepaintBoundary fails
Labels: framework,d: stackoverflow,has reproducible steps,P3,found in release: 2.2,found in release: 2.5,team-framework,triaged-framework

## Steps to Reproduce

- create a new project
- create your own custom RenderProxyBox and override the necessary functions
- add a scrollable widget as child 

<details>
<summary>Example code</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter 3D Cube Effect',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: Scaffold(
        onDrawerChanged: (isOpened) {},
        body: SafeArea(
          child: Column(
            children: [
              CustomRenderObjectWidget(
                  child: Row(
                children: [
                  const SizedBox(child: const Icon(Icons.ac_unit, size: 100,)),
                  const SizedBox(child: const Icon(Icons.save, size: 100,)),
                ],
              )),
              Expanded(
                child: CustomRenderObjectWidget(
                  child: ListView.builder(
                    itemCount: 40,
                    itemBuilder: (context, index) {
                      return Card(
                        child: Text("Item: $index"),
                      );
                    },
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class CustomRenderObjectWidget extends SingleChildRenderObjectWidget {
  const CustomRenderObjectWidget({Key? key, required Widget child})
      : super(key: key, child: child);

  @override
  RenderObject createRenderObject(BuildContext context) => CustomRenderObject();
}

class CustomRenderObject extends RenderProxyBox {
  @override
  void paint(PaintingContext context, Offset offset) {
    if (size.isEmpty || child == null) return;
    context.paintChild(child!, offset);
    context.paintChild(child!, offset + Offset(100, 100));
  }

  @override
  Size computeDryLayout(BoxConstraints constraints) {
    return _performDryLayout(
        constraints: constraints,
        layoutChild: ChildLayoutHelper.dryLayoutChild);
  }

  @override
  void performLayout() {
    size = _performDryLayout(
        constraints: constraints, layoutChild: ChildLayoutHelper.layoutChild);
  }

  Size _performDryLayout(
      {required BoxConstraints constraints,
      required ChildLayouter layoutChild}) {
    if (child == null) {
      return Size.zero;
    }
    return layoutChild(child!, constraints);
  }
}
```

</details>

**Expected results:** <!-- what did you want to see? -->
Scrollables like List or SingleChildScrollView should be drawn also multiple times.

**Actual results:** <!-- what did you see? -->
In this screenshot the problem is shown. The row child is shown two times, the list child below is shown only one time. 
<img src="https://user-images.githubusercontent.com/1241241/130679237-ea8c0475-5f52-43ad-94f6-1a1867fdeac5.png" width="300">

<details>
<summary>Flutter doctor -v</summary>
<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1165], locale de-DE)
    • Flutter version 2.2.3 at C:\Flutter
    • Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at ~\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = ~\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] IntelliJ IDEA Community Edition (version 2021.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.3
    • Flutter plugin version 58.0.3
    • Dart plugin version 211.7665

[√] VS Code (version 1.59.0)
    • VS Code at ~\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 92.0.902.78

• No issues found!
```

</details>