Error while accessing configuration file: Nextcloud is looking in the wrong directory

Nextcloud version: 18.0.2
Operating system and version: Client Ubuntu 18.04, server Debian
Client details:
nextcloud --version
Qt: Session management error: Could not open network socket
Nextcloud version 2.6.5-20200713.144448.adada8b2e-1.0~bionic1
Using Qt 5.9.5, built against Qt 5.9.5
Using Qt platform plugin ‘xcb’
Using ‘OpenSSL 1.1.1 11 Sep 2018’
Running on Ubuntu 18.04.5 LTS, x86_64

The issue you are facing:

When starting the Nextcloud client, I see the error message:

There was an error while accessing the configuration file at /home/tws/.config/Nextcloud/nextcloud.cfg. Please make sure the file can be accessed by your user.

I start nextcloud via a script that calls nextcloud & when I log into my computer (I use the i3 window manager).

I have just set up this computer, and the error message refers to the location of my home directory on another machine. I have a different user name on this machine.

I installed the client from the Ubuntu PPA, and used the GUI to point it to my self-hosted Nextcloud instance. My user name on the Nextcloud server and another laptop is tws, but I have a different user name on this laptop.

I’m not sure if this error is serious; after logging in, I can start the client from the command line and it works fine.

How can I tell the nextcloud client to look in the correct home directory for configuration files?