When db.printReplicationInfo() is run on secondary, it call db.printSlaveReplicationInfo() which is written to only work correctly when called on a primary as it uses "self" as "master" in getMaster():
This is wrong in that it (a) tests "self" when trying to getMaster. If it finds "self" it ends up returning that member.
Now printSlaveReplicationInfo is setting this node's optime to compare other nodes against and ends up printing things like:
Either it should find primary correctly (change check of "self" to be "state"==1 check) or it should print "behind" me rather than "behind the primary"