Post in the linked issue:
Interesting, if I run the flatpak's executable directly (bypassing the flatpak container), this issue does not occur:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/share/flatpak/app/io.github.cudatext.CudaText-Qt/current/active/files/lib $HOME/.local/share/flatpak/app/io.github.cudatext.CudaText-Qt/current/active/files/bin/cudatext
I have Qt6.7 in my host OS, while the flatpak currently uses 6.6. Unfortunately, we have to wait until the next stable release of Lazarus before it'll compile Qt6pas with Qt6.7.