As I wrote on forum, in Latte is bug which throws warning if dynamic block has different type (f.e. HTMLATTRIB) than primary type (f.e. HTML).
My simplified use case is here - petrknap/latte-incompatible-type-bug@c94603ef23ec205dcfa8e61c05188f2367db7e49