I haven't tried... So I don't know. But maybe the following is one of the puzzle pieces...
If you create your own project, and you add a package, then you make sure that your code contains a "uses some_unit_from_that_package". Or, well, if you don't, then nothing will happen. Adding a package means that the ppu for that package will be build, and that the search path for ppu will include the directory with those ppu. The rest only happens if there is a "uses" clause.
But then if you add e.g. AnchorDocking to the IDE, well you want something to happen. But, as explained, by just adding it to the lazarus.lpi => nothing does happen.
That magic happens in staticpackages.inc, which is $I included in the uses clause of lazarus.pp (or main.pp?). So to build lazarus you need an up to date staticpackges.inc.
And that resides in your pcp (primary config path). Because, depending on install the install dir may not be user-writeable and/or shared between different users with different config.
So to build, the current users pcp must be passed in the right place to get the correct staticpackages.inc.
I guess the lpi does by default not contain such info.
I don't know what other magic bits may be needed, and why (e.g. multi user setup of a single project).
I haven't read that other thread to find what issues it listed.
For the above, if you did not need a lazarus setup shared by multiple users, you could add the include path for staticpackages into your lpi (or move the file into the project dir, and keep it updated there).
And then you could find out what the next problem may be.
Obviously to try that, you have to undo the "no compiler" setting in the lazarus.lpi.