The most probable cause of this is network connectivity. You should ensure that the Kafka endpoint is accessible from within Data Collector's Docker container. Here are a couple of things you can try:
docker exec -it <container_id> bash
Then from the Docker container, run:
nc -v -z -w2 <kafka_host> 9092
And if you are running Kafka cluster on AWS, set the security group of your MSK cluster to be the same as your client machine and your Data Collector's EC2 instance's security groups. Then, add an inbound rule to that security group allowing "all traffic" from itself (the security group). For more details on this, click here.