Error while enabling Proximity in "sitl_on_hardware"

I am trying to debug a custom proximity sensor and interface that I added in ardupilot firmware, It connects with CAN.

I am trying to run the SITL_ON_HARDWARE firmware with the following command.

/Tools/scripts/sitl-on-hardware/sitl-on-hw.py --board CubeOrangePlus --vehicle copter --simclass MultiCopter --upload --enable-PROXIMITY_TI_ENABLED --enable-header-checks

However the compilation runs into an error

In file included from ../../libraries/AP_Proximity/AP_Proximity_TI_CAN.cpp:27:
../../libraries/AP_Proximity/AP_Proximity_TI_CAN.h:16:57: error: expected class-name before '{' token
   16 | class AP_Proximity_TI_CAN : public AP_Proximity_Backend {
      |                                                         ^
compilation terminated due to -Wfatal-errors.

Waf: Leaving directory `/media/zebu/f9737023-f8af-4cee-8a7e-1bf98a2b8439/ardupilot/build/CubeOrangePlus'
Build failed
 -> task in 'objs/AP_Proximity' failed (exit status 1): 
	{task 134631170884656: cxx AP_Proximity_TI_CAN.cpp -> AP_Proximity_TI_CAN.cpp.0.o}
 (run with -v to display more information)

Could someone help me figure out what am I doing wrong.

I tried the same launch command with --enable-PROXIMITY_MAV and I get the same error.
upon adding --enable-PROXIMITY, I get HAL_PROXIMITY_ENABLED redefinition error.