I had a similar issue on my CicviCRMCiviCRM fresh installation (CiviCRM 5.10.4) -> IIS10 webserver.
Error used to happen on both Joomla (3.9.3) and WordPress (5.0.1) versions.
The problem was that we see any relationship or activities table (DataTables warning: table id=DataTables_Table_0)
So, what I did to fix this problem is to add the following values in the app web.config. Do not forget any of these or it won't work.
<system.web>
<httpRuntime maxQueryStringLength = "12288" maxUrlLength="12288" />
</system.web>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="false">
<requestLimits maxAllowedContentLength="3000000000" maxUrl="4000000" maxQueryString="4000000" />
</requestFiltering>
</security>
<httpErrors existingResponse="PassThrough"></httpErrors>
</system.webServer>
Hope this helps !