Because of this the following line, there is a possibility that some standby tasks might not be created:
Then causing this line to not adding the task to standby task list:
But this line assumes that all standby tasks are to be created and add it to the standby list:
This results in user getting this error message on the next PARTITION_ASSIGNMENT state:
But the harm caused by this issue is minimal: No standby task for some partitions. And it is recreated on the next rebalance anyway. So, I suggest lowering this message to WARN. Or probably check to WARN when standby task could not be created.