How did you try to toggle the UART devices? /dev/ttyAMA0 should always be available on RPi 4, while only the mini UART can be toggled via dietpi-config, respectively setting enable_uart in /boot/config.txt, unless you swapped the primary UART via dtoverlay=miniuart-bt. If the latter overlay is enabled, enable_uart toggles /dev/ttyAMA0 instead. I am not sure whether dietpi-config shows it correctly in this case. However, if you do not use BT anyway, remove dtoverlay=miniuart-bt, if this is indeed causing the issue.