We were seeing similar issues in one of our environments and the following solved our problem;
When Oracle Data Provider for .NET is installed on a web server and depending on what you select during install, it writes entries into the machine.config file (located at C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\ depending on the framework version). It seems different versions of the ODP.NET installer do different things to the machine.config (some of our servers have no version number specified in the machine.config and others have a specific version number specified for the oracle managed client)
Depending on the version installed, it adds a couple of lines like this:
...
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
...
<oracle.manageddataaccess.client>
<version number="4.121.2.0">
<settings>
<setting name="TNS_ADMIN" value="C:\oracle\client\product\12.1.0\client_1\network\admin" />
</settings>
</version>
</oracle.manageddataaccess.client>
...
The entries contain a specific version number referring to the ODP.NET oracle client version.
We are building our applications with version 4.122.1.0 of the managed client library (Version 12.2.1100 nuget package) which doesn't match 4.121.2.0
We changed the above entries by removing the oracle managed client library version from this tag:
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess" />
And specifying a '*' for the version number for this tag:
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<setting name="TNS_ADMIN" value="C:\oracle\client\product\12.1.0\client_1\network\admin" />
</settings>
</version>
</oracle.manageddataaccess.client>
If you need specific version numbers specified then ensure your code is compliled with the same version numbers.
You can also remove all these entries from machine.config if they are there and specify them in the applications web.config depending on your configuration.