One thing I noticed a couple of years ago, the link order may not be the same as the include order, which is not an issue with Arduino, but with VSCode/VS2022 environments.
original thread: https://forum.pjrc.com/index.php?threads/changing-include-order.44930/
I don't know if something in the...