You may want to have 4.0 or 4.1 as step in between on your upgrade path. Just for safety.
Please also ensure that your postgresql is high enough (version wise, see: Software — Zammad documentation).
Apart from that:
Regarding your dist-upgrade:
disable and stop Zammad before you do that
ensure to have a backup (of course you’ll do! )
check if the dist upgrade also affects your database server - if so, ensure to have a clean data migration in between those versions
Please note that Zammad packages are distribution and version specific.
Skipping above mentioned step will cause you ending in a non functional Zammad installation.