If anyone still has this issue - the fix for me was that stating the credentials in the docker-compose/logstash.conf is just not enough -> they need to be set in logstash.yaml as well
xpack.monitoring.elasticsearch.username: <<username>>
xpack.monitoring.elasticsearch.password: <<password>>
thanks to David's response in this thread:
https://discuss.elastic.co/t/logstash-got-response-code-401-contacting-elasticsearch-url/317081/7?u=petar_nedyalkov