What is the difference between IQRn 0 and IRQn 1?
It shouldn't matter much, at least in this case.

Looks like the HAL library's handler HAL_TIM_IRQHandler calls all the capture callbacks you've registered and resets your timer's interrupt flag. If you don't use them, or don't care about the order in which they are executed with respect to your pin toggle, you can use either one.

The difference could be significant if your interrupt handler took a very long time to finish. If so, you could decide to clear the flag first in order not to lose the next event, etc.



Observations:


You could use HAL_GPIO_TogglePin(TEST_PIN_GPIO_Port, TEST_PIN_Pin); so you don't have to remember its last state.
Also, I believe the HAL library uses SysTick with a period of 1ms. You could maybe use that instead of a separate timer.