I ran into this problem when working on https://github.com/geany/geany-plugins/pull/528 - I wanted to improve it further to save/load the list of expanded directories from the sidebar to/from the project file and it didn't work.
@eht16 Do you still remember why you did it this way? Git blame shows you as the author:
https://github.com/geany/geany/commit/748d55216874be532570d5fc5a19958cd12129...
I guess there must have been some reason but I don't understand it.