Parameters not updating when reflashing firmware!

Quick background

I am experiencing strange behaviour with parameters that I have not been able to understand yet. I want to set all my parameters through the firmware flash (no editing or loading parameter files in qgroundcontrol). For this, I have set up all my parameters in the /boards/ark/fmu-v6x/init/rc.board_defaults. In this files, I set all my parameters to the values I want as defaults, for example:
param set-default SYS_HAS_NUM_ASPD 0

I do this for 1000+ params. I then compile the firmware for the correct board with this new rc.board_defaults config and flash it onto my v6x.

Issues

The main issue is that after flashing, many parameters are not updated when I look at them on QGC. As an example - in rc.board_defaults I set SYS_HAS_NUM_ASPD to 0. When I flash, I see on QGC that SYS_HAS_NUM_ASPD has a red 1 as its value, indicating it has been changed from firmware default. When I click Reset all params to firmware default, it doesnt change. When I change it to 0 manually and then click Reset all params to firmware default, it changes back to the red 1.

This issue happens to many parameters. Compared to the values I want them to have which I set in rc.board_defaults, they have the wrong values.

This did not only occur when I flashed new firmware through USB - I have also tried doing a complete chip and SD card erase through the SWD debug port, then reflashing bootloader and firmware, and the issue persists. This makes me think that the issue is not with my flashing process, or with some parameters being saved over and not overwritten from last firmware, but instead rc.board_defaults is not working as I expect, and the values I set as default there are either overwritten or not set.

What is the correct way to set up custom parameter values in firmware that I can modify in code and reflash as many times as I want - ensuring that those param values are always applied?