I can’t explain why replacing the keyboard would have effected your display. I’ve replaced keyboards in the Intel models, I haven’t tried doing a M1 series yet.
You may have reached too far here, I’m assuming you wanted a different keyboard layout from what you bought.
But where did you find the keyboard? So far I haven’t seen any parts on the market yet for the M1 series systems. Even still only the uppercase has been offered when a keyboard is needed for the 2016 onward systems as its just too hard to replace the keyboard alone.