1) disable the firwall record in ispconfig to stop bastille.
2) Install ufw
3) run a ispconfig update with reconfigure services
4) set firewall type to ufw in ispconfig and enable the firewall record again.

If I follow these steps without step 3 I'm no longer able to connect through ssh despite this port is set to be open. Or could it be that fail2ban is not working correctly with ufw?

I will try to change with performing step 3.

By the way. If you change your server firewall and the state within one update cycle of ISPConfig i.e. in a short period it will first update the firewall status and then the server config. So if you change from Bastille to UWF and you switch it off and wait (until the job queue is finished). And then change the config en status it will activate Bastille again instead of UWF. Bottom line… wait until the server config is updated and then change firewall status.