Setting the Connection Profile in Configuration->Connection Profiles for a specific project in TDM Portal, applies to all the projects. This functionality, causes the published generator to fail because it attempts to use the last connection profile that was set at a project level in Configuration->Connection Profiles.
The functionality is by design.
Release : 4.9..x
Component : TDM Portal Generator
The setting in Configurations-->Connection Profiles shown in the Portal are from Datamaker and it will be applicable to all the projects by design but not to the specific project.
Support Recommendation is to make the specific configuration Active in the Generator as in the below screenshot.
and don't set anything in the Configuration-->Connection Profiles. This way, publish job will pick the connection profile from the Generator-->Configurations instead of the Configuration-->Connection Profiles as in the below screenshot.