Broker may not be available issue

I have a 2 node kafka cluster (1 ZK and 2 Brokers). I am testing HA of the setup. Each topic has a replication factor of 2 and has 4 partitions.
I have a kafka streams application running which reads data from a topic and sends to another topic. This application has 4 stream threads configured.

I did the following to test HA:

  1. Bring down the broker which is the group coordinator. The other broker now becomes the group coordinator for my streams application. All the 4 streams consumer threads are able to identify this change and rebalance as expected.

  2. After this I brought up the first broker, still everything is fine.

  3. Now I bring down the 2nd broker (which is the group coordinator now). I observe that 2 of the 4 consumer threads become the part of the group, the other two threads continuously keep on giving the BROKER MAY NOT BE AVAILABLE warning.
    Sometimes the number of threads having issue is 1 or 2 or 3(it varies).

Can someone help me understand what is causing this?