If your local machine and your CI runner have different architectures — which is common now with ARM laptops and x86 runners — this bites much harder, and it will bite you again with other native dependencies.
The durable fix is to make the build environment identical rather than similar: build in a container, with the same base image locally and in CI. Then the lockfile is generated and consumed on the same platform and the whole class of problem disappears.
More setup than editing a dependency list, and it also solves the next four versions of this question.