🇦🇺Australia granticusiv
Following up from my own comment above, I was triggering the "Cannot access constant" error when I switched the base theme in my sub-theme's info.yml (in my case, switching from bootstrap to bootstrap_barrio). My workaround was to create a clone of my sub-theme and base it on bootstrap_barrio and leave the origin sub-theme based on boostrap. The pipeline was fixed in the next deployment.
🇦🇺Australia granticusiv
I'm not sure if it's of any help, but I did find this regex '#Cannot access constant (\w+)#' in the ignore rules for PHP standards in GovCMS - https://projects.govcms.gov.au/GovCMS/govcms-ci/-/blob/master/config/php...
I was suddenly encountering the same "Cannot access constant ...." error for the bootstrap theme last week, but now I'm not.