The default APFS format used by the macOS installer is case-insensitive but case-preserving. Opening Readme.md when the file is README.md succeeds locally and fails on the case-sensitive filesystem of a Linux build agent. The mismatch surfaces as an import that resolves on a laptop and fails in CI with a module-not-found error.
Git detects the filesystem and sets core.ignorecase to true in a repository created on such a volume. That option makes Git ignore case differences when scanning the working tree, which is why renaming Foo.js to foo.js appears to change nothing: git status stays clean and no commit is produced. The reliable rename is two steps through a temporary name, or one command with explicit staging: 'git mv --force Foo.js foo.js' works on recent Git, and 'git mv Foo.js tmp && git mv tmp foo.js' always works.
To catch the class of bug rather than each instance, create a case-sensitive APFS volume in Disk Utility and keep checkouts there, or add a CI step that greps for imports whose case does not match the file on disk.