Elementary OS 6: Emacs 27.2 + Spacemacs: `An error occurred while loading ‘/home/dmayr/.emacs.d/init.el’: Symbol's value as variable is void: ‹\213`

In Elementary OS 6, when installing Emacs from flathub, the following error message shows up:

Warning (initialization): An error occurred while loading ‘/home/dmayr/.emacs.d/init.el’:

Symbol's value as variable is void: ‹ \213

I’m using Emacs along with Spacemacs, the popular configuration.
Therefore, Emacs needs to read the ~/.emacs.d directory.

In your experience, could it be a package compilation bug, a flatpak sandboxing effect, or something else?

This doesn’t happen with Emacs installed from the kelleyk PPA or via Ubuntu snap, it’s just the flatpak package.