Afaik / IIRC a parameter given on the command line should take precedence over a parameter given in lazarus.cfg. However I am not sure what happens if you mix different writings of the same param. E.g. -pcp vs --primary-config-path. (mixing them like this may not be supported).
If you use the exact same spelling in the file and the commandline, then it should work.
There may be yet another solution (but I am not sure / have not tested it / and it may fail, if you use File=>Restart).
The lazarus.cfg file is also seen by startlazarus. And then passed to lazarus as commandline args. So (I guess) if you have different folders, each just with startlazarus.exe and lazarus.cfg then that might do what you want. Of course in the config to which you point, the real lazarus directory needs to be configured, so startlazarus will find the lazarus.exe.
edit: I might be wrong, it may be that startlazarus will only find the lazarus.exe, if the latter is in the pcp (together with the xml files, or in a subfolder thereof)