Hardware serial /dev/ttyAMA0 not available when software serial is off

I try to enable hardware-serial port /dev/ttyAMA0 and disable software-serial to interact with a RS485/ModBus shield. Bluetooth is disabled.

/dev/ttyAMA0 is only available when ttyS0 (mini UART) is on. When it is off, /dev/ttyAMA0 is not there.

How do I disable /dev/ttyS0 without losing /dev/ttyAMA0?

RPI4 Model b 8GB
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=21
G_DIETPI_VERSION_RC=1
bullseye

Linux 6.1.21-v7l+ #1642 SMP Mon Apr 3 17:22:30 BST 2023 armv7l GNU/Linux

@MichaIng can you have a look pls

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.