Fixing `Error: Method not found: 'FallThroughError'. load_bundle_task_state.dart:17 throw FallThroughError();, Target kernel_snapshot failed: Exception`

This error came from ~/.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.9.1/lib/src/platform_interface/utils/load_bundle_task_state.dart.

I tried a flutter clean. Then recompiled but it still threw the error. I have run flutter pub upgrade --major-versions, then flutter pub outdated to make sure there is no large version gap:

% flutter pub outdated
Showing outdated packages.
[*] indicates versions that are not the latest available.

Package Name    Current  Upgradable  Resolvable  Latest  

direct dependencies:
firebase_auth   *4.2.2   *4.2.2      *4.2.2      4.3.0   
google_sign_in  *5.4.4   *5.4.4      *5.4.4      6.0.2   

dev_dependencies: all up-to-date.

I didn't see anything out of the ordinary. I tried my luck at running the project again, and somehow it compiled!...