LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory) while x-forwarding
The solution to this issue was to install 'dbus-x11'.
sudo apt-get install dbus-x11
I came to this solution by looking for similar issues.
I've found Pablo Saratxaga's answer on Serverfault, suggesting a script for a similar issue.
https://serverfault.com/a/673837/409813
I've thought it would be worth to run
export $(dbus-launch)
because this is the main command that the script is starting.
The error message from the output is the following.
The program 'dbus-launch' is currently not installed. You can install it by typing:
apt install dbus-x11
I installed dbus-x11 and x-forwarding started to work without showing an error message.