I also had issues with headless-build.bat It does not support the -import option meaning it needs an existing work space with the projects already imported.This is an limitation that is added by headless-build.bat.I ended up with copying the headless...
Just took a brief look at you code the first thing i can think of is try call HAL_ADC_Start after HAL_ADC_MspInit. It also looks like you code expect to use Continues Conversion mode being enabled which is not the case. If using continues conversion ...