Repository: flutter
Issue: NSInternalInconsistencyException(Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.)
Labels: c: crash,platform-ios,a: production,P2,c: fatal crash,needs repro info,team-ios,triaged-ios

### Steps to reproduce

The crash is occasional. I refer to issue https://github.com/flutter/flutter/issues/135501 that illustrates the crash will 
be solved after 3.16.x.  But I meet the occasional  crash on flutter 3.22.2

### Expected results

NO crash

### Actual results

Crash

### Code sample

No code

### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

crash info

```
Triggered by Thread:  64 io.flutter.2.raster 


Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'

0  CoreFoundation                 0x00000001a0e5cf20 0x00000001a0dd9000 + 540448
1  libobjc.A.dylib                0x0000000198d072b8 objc_exception_throw + 60
2  CoreAutoLayout                 0x00000001c2108224 0x00000001c20f6000 + 74276
3  CoreAutoLayout                 0x00000001c20fb89c 0x00000001c20f6000 + 22684
4  CoreAutoLayout                 0x00000001c20f8208 0x00000001c20f6000 + 8712
5  CoreAutoLayout                 0x00000001c20f7f94 0x00000001c20f6000 + 8084
6  UIKitCore                      0x00000001a30b7264 0x00000001a305c000 + 373348
7  UIKitCore                      0x00000001a306c918 0x00000001a305c000 + 67864
8  QuartzCore                     0x00000001a24ca26c 0x00000001a244b000 + 520812
9  QuartzCore                     0x00000001a24c9df0 0x00000001a244b000 + 519664
10 QuartzCore                     0x00000001a2524fd8 0x00000001a244b000 + 892888
11 QuartzCore                     0x00000001a2499ee0 0x00000001a244b000 + 323296
12 QuartzCore                     0x00000001a24e3c34 0x00000001a244b000 + 625716
13 CoreFoundation                 0x00000001a0dfd658 0x00000001a0dd9000 + 149080
14 CoreFoundation                 0x00000001a0dfd414 0x00000001a0dd9000 + 148500
15 CoreFoundation                 0x00000001a0e2c54c 0x00000001a0dd9000 + 341324
16 CoreFoundation                 0x00000001a0e2bcd8 CFRunLoopRunSpecific + 608
17 Flutter                        0x0000000112585fa4 fml::MessageLoopDarwin::Run() (../../flutter/fml/platform/darwin/message_loop_darwin.mm:52)
18 Flutter                        0x0000000112585618 __thread_proxy<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct> >, (lambda at ../../flutter/fml/thread.cc:79:7)> > (../../flutter/fml/message_loop_impl.cc:0)
19 libsystem_pthread.dylib        0x00000001fd8b606c _pthread_start + 136
20 libsystem_pthread.dylib        0x00000001fd8b10d8 thread_start + 8
```

### Flutter Doctor output

```
Flutter 3.22.2 
Framework • revision 761747bfc5 (4 个月前) 
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3
```