I have had this problem occur with both my MBPros, turned out to be a tiny amount of. lint. that made its. way into. the ports. Now. I use. usb-c port covers to keep it in check.
I. of course have. keyboard. issues. as well – in case the random periods. and multiple spaces thing did not. make it obvious.
Figured this would. be a good time to. not correct the. issues. Along with the space bar my left command key doesn't always register, its shit.