cannot get relatedTo by slug only ID
It does not work because the function does not accept slugs. Not sure what to answer here. It only accepts objects of type Element and ids as identifier.

You can see the magic here

foreach ($elements as $element) {
if (is_numeric($element)) {
    $relElementIds[] = $element;
} else if ($element instanceof ElementInterface) {
    $relElementIds[] = $element-&gt;id;
} else if ($element instanceof ElementQueryInterface) {
    foreach ($element-&gt;ids() as $id) {
        $relElementIds[] = $id;
    }
}


These are all kind of things that the relatedTo can use/work with. If you want to get a relation by slug you have to fetch the element first.

.relatedTo(craft.categories.slug('municipal').one())