Branding Smite throws an error when the weapon attack occurs because it is unable to read actor.flags["midi-qol"].brandingSmite.level. This is because the flag was already removed due to the DAE expiring immediately upon hitting.
The fix is to move the setting of brandingSmite.level into its own DAE with no special expiration condition (so it will expire when caster concentration is removed AFTER all the hit processing):
Branding Smite throws an error when the weapon attack occurs because it is unable to read actor.flags["midi-qol"].brandingSmite.level. This is because the flag was already removed due to the DAE expiring immediately upon hitting.
The fix is to move the setting of brandingSmite.level into its own DAE with no special expiration condition (so it will expire when caster concentration is removed AFTER all the hit processing):