Rebuild fails from theme error, site won't start

Did you figure out what caused the issue in the first place? If possible I’d like to find out the root cause so that we can prevent it happening to anyone in the future - broken rebuilds are pretty annoying!