HdyHeaderBar is directly the titlebar of that GtkApplicationWindow here, but it's as broken if I add many layours of GtkBox in the middle. It works fine with GtkHeaderBar.
HdyHeaderBar
GtkApplicationWindow
GtkBox
GtkHeaderBar