Again same situation when running both commands from a shell buffer. But with `comint-osc-process-output' added to `comint-output-filter-functions' then everything looks good. It seems that flatpak-builder outputs OSC sequences and ANSI sequences.