Sounds ridiculous, but I just solved this a moment ago by adding
targetFramework="4.8"
to the httpRuntime element in the <system.web> area in the web.config
The other attributes aren't relevant here, but for clarity, my updated line is
<httpRuntime executionTimeout="600" maxRequestLength="8192" enableVersionHeader="false" targetFramework="4.8" />
This sits well with Richard Deeming's comment about the 4.8 version. My project build Target Framework was already .Net Framework 4.8 so I'm not sure why this line in the web.config was necessary, but it was, both on my local machine and on the production host.