I'm interested to learn if there have been notable cases of a game maker accepting code or game engine portions developed by fans to replace their own buggy/flawed/slow parts, or even complete game remakes that turned official. For open-source games it should not be uncommon, but I'd like to know if there were any closed-source games which did that and the details of such occurrence.
For example, if Dark Souls was remade on Dark Souls 3's engine to improve world mesh clipping, graphics and framerate.
The goal is to find out how realistic it would be to remake or improve some (possibly old) games and figure out all the legal intricacies so it would be allowed for public distribution.