Why does my onchange function for disabling form fields not work properly?

I have the two form select menu “transactionSelection” and “categorySelection”. My goal is to disable “categorySelection” if the value of “transactionSelection” is “income”. Therefore I have the function “disableSelection()”. The menu “categorySelected” should by default be disabled.

<label for="transactionSelection" class="form-label mb-0">Transaktionsart</label>
<select class="form-select" id="transactionSelection" onchange="disableSelection()" aria-label="Transaction selection">
    <option value="income">Einnahme</option>
    <option value="spendings">Ausgabe</option>
<label for="categorySelection" class="form-label mb-0">Kategorie</label>
<select class="form-select" id="categorySelection" aria-label="Category selection" disabled>
    <option value="income">Einnahmen</option>
    <option value="mobility">Mobilität</option>
    <option value="home-entertainment">Heimunterhaltung</option>
    <option value="going-out">Ausgehen</option>
    <option value="sport-activities">Sportaktivitäten</option>
    <option value="real-estate">Wohnen</option>
    <option value="insurance">Versicherungen</option> 
    <option value="cost-of-living">Lebenshaltungskosten</option>
    <option value="investing">Investments</option>
    <option value="telecommunication">Telekommunikation</option>
    <option value="media-subscription">Medienabos</option>
    <option value="philanthropy">Philantropie</option>
    <option value="financial-cost">Finanzkosten</option>
    <option value="vacation">Urlaub</option>
    <option value="education">Bildung</option>
    <option value="emigration">Auswanderung</option>
    <option value="other">Sonstiges</option>
</select>
<script>
    function disableSelection() {
        if (this.value == 'income') {
            document.getElementById('categorySelection').disabled = true;
        }
        else {
            document.getElementById('categorySelection').disabled = false;
        }
    }
</script>

However, this is only working once. After selecting the other value of “transactionSelection”, the disabled attribute of “categorySelection” disappears and will not set again. When I remove the disabled attribute, it will never set at all, so it seems that the function does not get called. Other js (like several chart.js charts) are working fine.

What am I doing wrong here?