Difference between all_nodes VS cluster_nodes CouchDB 2.X cluster membership?
Your question has possibly been answered (in part) in the Server Fault Q &amp; A:

BigCouch all_nodes vs cluster_nodes

The official documentation states that when you add a node to the CouchDB cluster, the output of the query _membership will return a list of all_nodes and cluster_nodes. No indication that this information may differ unless you account for: 


  to see the name of the node and all the nodes it knows about and are connected too.


...which slightly implies that there may be differences.

The linked Server Fault answer refers to Robert Newson, who is a developer of CouchDB:


  I just heard from Robert Newson on IRC that BigCouch nodes are connected lazily.


I guess that is a quite an authoritative answer in that case. 

When you request the _membership page, CouchDB might have connected all the nodes, or it might not have. This would explain why you noted differences in the all_nodes and cluster_nodes listings.  



In your specific case where all_nodes contains more information than cluster_nodes the cause is explained in the official documentation:


  
  all_nodes are all the nodes thats this node knows about.
  cluster_nodes are the nodes that are connected to this node.
  


You had a situation where the node you were querying was aware of other nodes (all_nodes), but none of them were part of your cluster (clustered_nodes).



It seems like only the developer or the community on Github could answer your question completely. Consider asking your question on Github, or opening an issue on the apache/couchdb Github page.