Repository: flutter
Issue: Failed assertion: line 4449 pos 7: 'SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle'
Labels: c: crash,framework,P3,needs repro info,team-framework,triaged-framework

### Steps to reproduce

Happens occasionally while starting application in debug mode.

### Expected results

No exceptions on startup

### Actual results

exception on startup

### Code sample

<details open><summary>Code sample</summary>

```dart

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
Seems to always happen 3 times

======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
RenderParagraph._scheduleSystemFontsUpdate() called during SchedulerPhase.midFrameMicrotasks.
'package:flutter/src/rendering/object.dart':
Failed assertion: line 4449 pos 7: 'SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack: 
#2      RelayoutWhenSystemFontsChangeMixin._scheduleSystemFontsUpdate (package:flutter/src/rendering/object.dart:4449:7)
#3      _SystemFontsNotifier.notifyListeners (package:flutter/src/painting/binding.dart:187:15)
#4      PaintingBinding.handleSystemMessage (package:flutter/src/painting/binding.dart:176:22)
<asynchronous suspension>
#5      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235:36)
<asynchronous suspension>
#6      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:581:22)
<asynchronous suspension>
(elided 2 frames from class _AssertionError)
====================================================================================================

======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
RenderParagraph._scheduleSystemFontsUpdate() called during SchedulerPhase.midFrameMicrotasks.
'package:flutter/src/rendering/object.dart':
Failed assertion: line 4449 pos 7: 'SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack: 
#2      RelayoutWhenSystemFontsChangeMixin._scheduleSystemFontsUpdate (package:flutter/src/rendering/object.dart:4449:7)
#3      _SystemFontsNotifier.notifyListeners (package:flutter/src/painting/binding.dart:187:15)
#4      PaintingBinding.handleSystemMessage (package:flutter/src/painting/binding.dart:176:22)
<asynchronous suspension>
#5      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235:36)
<asynchronous suspension>
#6      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:581:22)
<asynchronous suspension>
(elided 2 frames from class _AssertionError)
====================================================================================================

======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
RenderParagraph._scheduleSystemFontsUpdate() called during SchedulerPhase.midFrameMicrotasks.
'package:flutter/src/rendering/object.dart':
Failed assertion: line 4449 pos 7: 'SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack: 
#2      RelayoutWhenSystemFontsChangeMixin._scheduleSystemFontsUpdate (package:flutter/src/rendering/object.dart:4449:7)
#3      _SystemFontsNotifier.notifyListeners (package:flutter/src/painting/binding.dart:187:15)
#4      PaintingBinding.handleSystemMessage (package:flutter/src/painting/binding.dart:176:22)
<asynchronous suspension>
#5      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235:36)
<asynchronous suspension>
#6      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:581:22)
<asynchronous suspension>
(elided 2 frames from class _AssertionError)
====================================================================================================
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-x64, locale en-US)
    • Flutter version 3.22.2 on channel stable 
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (6 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Android Studio (version 2023.2)
    • 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.9+0-17.0.9b1087.7-11185874)


```

</details>