I now have both the 2018 and 2021 12.9 pro with last year’s Magic keyboard. If you close them and look though at a light source, both iPad have a tiny gap between the keyboard and screen at the hinge side, the keyboard only touches the screen at the other side (volume keys). you can see just a bit more light with the older iPad than the new one, but there is no issue with closing and strength of magnet when the new iPad is fixed to the keyboard.
I would save money and buy the last year’s model unless you want the white colour.
P.S. I asked multiple staff at Apple store today, they all confrimed the older magic keyboard works fine with the 2021 iPad Pro 12.9.