mg95
I've never heard of an install failure due to bad IMEI on this forum.
Separate from IMEI, just make sure that the phone isn't "Carrier Locked".
You can check it on a candidate phone using these instructions:
Enable the developer options menu by going to Settings > About phone/tablet and repeatedly pressing the Build number menu entry until developer mode is enabled.
Next, go to Settings > System > Developer options and toggle on the OEM unlocking setting.
https://grapheneos.org/install/web#enabling-oem-unlocking
If the "OEM unlocking" button is togglable as described above, your device should be able to install GOS.
Some more info about it here:
Devices sold in partnership with specific carriers may be locked by the carrier, which will prevent installing GrapheneOS. This is primarily an issue with US carriers and isn't common elsewhere in the world. To avoid this, either don't buy a carrier device, or make sure it can be unlocked. It's the same hardware/firmware/software either way but carriers dislike having devices able to bypass their paywall for tethering, etc., so they disable it for the devices they sell as part of contracts.
https://grapheneos.org/faq#supported-devices