You can not maintain the changes. You’re going to have to run one or the other. I suggest backing up the custom version, so you do not lose it, and installing a fresh version to see if the error goes away. If it does, then you know for sure it is a bug in your custom version and if it doesn’t something else is amiss.
I also suggest checking your PHP error log as that might clue you in on what the source of the error is.
I hope that helps.