Repository: flutter
Issue: [macOS] Assertion failure and crash when using the MOS app for smooth scrolling
Labels: engine,platform-mac,a: error message,a: mouse,P3,team-macos,triaged-macos

### Steps to reproduce

1) Download the app here: https://mos.caldis.me (https://github.com/Caldis/Mos/blob/master/README.enUS.md)
2) Install it and enable the smooth scrolling feature
3) Scroll up or down in any ListView

Is there a way to disable NSAssert in release builds without having to rebuild the Flutter Engine myself?

### Expected results

ListViews should scroll normally

### Actual results

```
Assertion failure in -[FlutterViewController dispatchMouseEvent:phase:], FlutterViewController.mm:697
Received gesture event with unexpected phase
```

It can be found here: https://github.com/flutter/engine/blob/c9b9d5780da342eb3f0f5e439a7db06f7d112575/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm#L697

### Code sample

No sample required

### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[!] Flutter (Channel stable, 3.24.2, on macOS 14.6.1 23G93 darwin-arm64, locale ru-RU)
    • Flutter version 3.24.2 on channel stable at /Users/kbukaev/Flutter
    ! Warning: `flutter` on your path resolves to /Users/kbukaev/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/kbukaev/Flutter. Consider adding
      /Users/kbukaev/Flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/kbukaev/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/kbukaev/Flutter. Consider adding /Users/kbukaev/Flutter/bin to
      the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (9 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2
    • If those were intentional, you can disregard the above warnings; however it is recommended to use “git” directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/kbukaev/Library/Android/sdk
    • Platform android-34, build-tools 33.0.2
    • 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.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2
[✓] 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:
      :hammer: https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      :hammer: 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.93.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.96.0
[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 128.0.6613.120
    ! Error: Browsing on the local area network for iPad (Kirill). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
    • All expected network resources are available.
! Doctor found issues in 1 category.
```

</details>