I used termux with su privileges (su) and used following commands (if you do not have root access, then use adb):
setprop persist.dbg.allow_ims_off 1
setprop persist.dbg.volte_avail_ovr 1
setprop persist.dbg.vt_avail_ovr 1
setprop persist.dbg.wfc_avail_ovr 1
setprop persist.sys.phh.ims.caf true
In options → network → sim card I have the option to set volte calling or wifi calling.
source: GitHub - khrj/volte-fix: Fixes Qualcomm VoLTE on all GSI Treble Roms
(XZ1 with telefonica)