Russia must have known the consequences of firing dumb missles close to the borders. This has been Putin game all along. He is escalating to see if NATO won't cower in fear and force Ukraine into negotiations
Reports from Poland indicate it was a recoil from a missile shot down by Ukrainian forces. Even if that is not true, it more likely than not would have been just a miscalculated shot. They did not deliberately send a missile to Poland to ‘test’ NATO, they know very well any deliberate attack on NATO will cause a response.
It really is not something that should or will escalate into anything bigger. Very unfortunate that two people died as a result but it’s just bad luck.