A genuine Surface Go 2 Type Cover should work with the Surface Go 2.
If you accidentally bought a Type Cover for a different Surface mode, it will not work even though it may look similar.
--
Turn off the Surface.
Disconnect the Type Cover.
Gently clean the magnetic connector contacts on both the tablet and the keyboard with a soft, lint-free cloth. If needed, lightly dampen the cloth with isopropyl alcohol (70% or higher), then let it dry completely.
Reattach the cover firmly.
Inspect pins closely- Check if there is any bent.
it's most likely either a DOA cover or connector damage on that unit