Some files from the build of the master branch are left over in the directory where it’s installed. Delete the installation directory, compile and install again, and it should work.
Same thing happened to me recently and it took a while to figure out what was going on…
Try deleting both the installation directory and the build directory within the project, and rebuild and install from scratch. If that doesn’t fix it I’m not sure what’s going on.
Use the --configdir command line parameter to have one of the versions use an alternate config / db directory. The default directory on Linux is ~/.config/darktable.
On my system I have the stable version 3.6.0 installed in the default location using the distribution’s package, and that one uses the default config directory. I then have the latest git version installed in /home/paolo/darktable, and I use this shell script to run it with an alternate directory: