Symptoms were the same as
When we try to use -Dstapler.jelly.trace=true, there are several things no longer working in Jenkins.
This property will add comments explaining where the jelly fragments are coming from. This is very handy when debugging multiple plugins at once.
1) Due to the usage of firstChild in Jenkins core, instead of firstElementChild, the comment node is returned while an element is expected. FirstChild can return Element, TextNode or CommentNode, while firstElementChild only Element.
2) Due to the fix for SECURITY-534, the comments now force the flush of the output, meaning the check for dispatchAllowance is triggered earlier than expected and failed for ajax.jelly (layout using by all the ajax parts, like ajaxExecutors.jelly)