Repository: flutter
Issue: Crash in RenderObject.getTransformTo
Labels: c: crash,framework,a: production,P2,needs repro info,team-framework,triaged-framework

### Steps to reproduce

Not sure how to reproduce the scenario. Got thousands of crashes reported into Crashlytics.

### Expected results

Flutter framework shouldn't crash. Looking at the source code owner is force casted to non null:

`final RenderObject? rootNode = owner!.rootNode;`

### Actual results

Flutter framework crashes with null pointer exception. Would be nice to understand if this is a bug in Flutter and if not, in which scenario this can happen.

### Code sample

-

### Screenshots or Video

_No response_

### Logs

<details open><summary>Logs</summary>

```console
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown .
#00 pc 0x365b13 com.app.redacted (RenderObject.getTransformTo [object.dart:3337]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#01 pc 0x365bb3 com.app.redacted (RenderBox.localToGlobal [box.dart:2619]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#02 pc 0x3e4f23 com.app.redacted (_PlatformViewPlaceholderBox.performLayout.<anonymous closure> [platform_view.dart:1279]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#03 pc 0x9f0d3b com.app.redacted (SchedulerBinding._invokeFrameCallback [binding.dart:1386]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#04 pc 0x9f0b7f com.app.redacted (SchedulerBinding.handleDrawFrame [binding.dart:1322]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#05 pc 0x3a8997 com.app.redacted (SchedulerBinding._handleDrawFrame [binding.dart:1169]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#06 pc 0x3a884b com.app.redacted (SchedulerBinding._handleDrawFrame [binding.dart:1151]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#07 pc 0x325f63 com.app.redacted (_invoke [hooks.dart:312]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#08 pc 0x3280b7 com.app.redacted (PlatformDispatcher._drawFrame [platform_dispatcher.dart:399]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#09 pc 0x32806b com.app.redacted (_drawFrame [hooks.dart:283]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
#10 pc 0x3280e7 com.app.redacted (_drawFrame [hooks.dart:281]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf)
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.5, on macOS 13.5 22G74 darwin-arm64, locale en-GB)
    • Flutter version 3.19.5 on channel stable at /Users/developer/Downloads/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (8 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
    • Android SDK at /Users/developer/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0-rc2
    • ANDROID_HOME = /Users/developer/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.86.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.82.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.5 22G74 darwin-arm64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 124.0.6367.208

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>