What will happen if a 2 node replica set lose its primary?

This thread is related or the same as What happens if a 2 node replica set lose its primary?.

Please explain how you did

From you output, it appears that you have removed one of the node from the replica set because the members: array only has 1 member. If you did that, then you do not have a 2 nodes replica set anymore. You have a 1 node replica set. It is normal to have it as the PRIMARY.