I'm not sure what to say. I'm not sure we can help you.
You need someone who knows what they are doing to look at your installation, work out what has happened. And put this right.
Please don't take this badly but you have a system that looks like it was installed by someone who didn't know what they were doing. It is now trying to be fixed by someone who does not know what they are doing.
My solution is to take the two installs - which really means their database and 'moodledata' areas, and make two new installs with all new code that are definitely not inside each other. That would be a good start.
At the moment you have two intertwined installs - almost certainly with mixed up versions of code. That's pretty bad. There's no fixing that. You have to start again.