Having two controllers connected to the LCD sounds horrible in both software and hardware.
The two controllers would have to be able to talk to each other anyway, to make sure both don’t talk to the LCD at the same time.
So long as you have to connect pins between the controllers, why not just send information from one controller to the other serially?

I would go for making both programs identical, both outputting to the LCD pins, but neither assuming the LCD is connected,
and both programs listening on a serial port for information from another chip.
Then maybe one flag set at compile time to set which has the LCD.
That’s if I were in that position, which wouldn’t happen because one chip would be watching both rotary encoders