The sentence is a little confusing. Did you say you did a graceful takeover on the standby and the standby because primary. When you do db2pd -db $DBNAME -hadr it says 'Primary' as the role, and now if you issue a connect you are not able to connect.
What privileges does the user id have ?
What is the DB state, is it active ?