Encountering the same problem. New Surface Pro 7 (about 6 weeks old). The type cover works fine on an older SP4 device. The type cover also works fine when booted into the UEFI (well at least the first time it did). It will sometimes work when booted into Windows, but it easily disappears (often after a random "AutoRotate On" pops on the screen, but not always). Looking at the Device Manager, the Type Cover is there as a hidden device, but shows as disconnected. Disconnecting and reconnecting type cover doesn't seem to change anything, though keeping the screen completely flat on the desk does seem to make it work more often. It really doesn't like to work with the Surface resting on the type cover in a normal "laptop" posture". In fact, just lifting the top edge of the screen a cm or less off the desk causes Device Manager to "lose" the type cover.
I turned on the Rotation Lock, so that AutoRotate wouldn't show up. The type cover will still disappear as I try to bring the display back to a kickstand/laptop posture, though it doesn't happen as immediately like when AutoRotate is enabled. I can sometimes get the display vertical and let the type cover hang down and it keeps working. Maybe it is something funky in the hardware connections inside the type cover itself, but it really seems to work with zero issues on another device.
I have run the full Surface Diagnostics Toolkit with nothing found. I have done a Windows Reset with no change in behavior. It still seems like a software issue (since another type cover seems to have the same problem). If it were a hardware problem on the device itself, I don't see why the posture of the screen to keyboard would matter. Those magnets are strong enough not to create any kind of slippage.