Using nanopb as a user library - conflicting with Particle Toolchain

I am using nanopb on a bsom and have recently run into the issue where my generated header file is linking to the particleOS toolchain nanopb, instead of the nanopb I’ve included as a user library.

As a result I am having a version mismatch as the user library version is later than that of ParticleOS.

My project structure is:

projectRoot:
    src:
        firmware.ino
        test.pb.c
        test.pb.h
    lib:
        nanopb:
            pb.h
            pb_common.c
            ... <snip>
            pb_encode.h

When I attempt to compile I get error: #error Regenerate this file with the current version of nanopb generator.

And when I peek the version it is referencing, it is linking to the toolchain version:
usr\.particle\toolchains\deviceOS\1.5.2\third_party\nanopb\nanopb\pb.h as opposed to the local version at lib\nanopb\ (whose PB_PROTO_HEADER_VERSION is correct)

Any advice would be greatly appreciated.

Note: This was working fine until I upgraded my user library to a version of nanopb > than the toolchain version