Caution:

All layers referencing an enterprise geodatabase or database must share a single connection to that database. This error may trigger even though the source database is the same; for example, if you have multiple connections to the same database and used different connections to add layers to the data frame, this error will result when you analyze.

Make sure that you use a single, common connection to the geodatabase or database when adding the data to your map or setting the data source for an existing layer.