Thanks for the replies all.
I think the problem is something in one of my settings because when I do the following simple arcpy command in python:
import arcpy
arcpy.env.workspace = "Database Connections\\xyz_select@geooraint.sde"
featureclasses = arcpy.ListFeatureClasses()
print (str(len(featureclasses)))
It gives me 0 results. This is straight from python. So arcpy from python seems to think there are no feature classes in the old geodatabase.
When I run the exact same command from the python window in arcmap i get something like 1600 results, which should be correct.
Both python versions give the same version number (2.7.12).
Does anyone have an idea of a setting that I need to change?