Linker error on local dependency but not on external repo

I’ve got 4 situations:
compiling for esp8266/Arduino with
lib_extra_dirs = path/to/local/clone
→ compiles

compiling for esp8266/Arduino with
lib_deps = https://github.com/user/repo.git
→ compiles

compiling for esp32/Arduino with
lib_deps = https://github.com/user/repo.git
→ compiles

compiling for esp32/Arduino with
lib_extra_dirs = path/to/local/clone
→ does not compile

I’ve got linker errors on internal files of the library.

This lib generates the linker errors: PlatformIO Registry for all the “packet types”.

Do you use the same platformio.ini with different build environments?