The file browser is supposed to use the user's home directory by default on new installations. On macOS this fails.
The cause is that the file browser shows the directory hierarchy under /Volumes to give access to all discs. This means the current system's root is here located at something like /Volumes/System, which is the same as /.
The home directory is reported as something like /Users/username. But the file browser would expect the full path, e.g. /Volumes/System/Users/username.
Note that "System" is the name of the root partition. This could be different. System would be the default, but e.g. on my setup currently it is named "BetaSystem", because I use this partition to install the latest macOS beta. System also exists, but is a separate macOS install I am currently not running.
So we need to detect the current root volume and prepend it to the user name.