You have an usual capture tag placement. Those are not wrapped around anything so won’t be doing anything other than grabbing an empty string.
Did you intend to put them around the {{ new_order | first}} and last outputs?
Doesn’t mean that is your prob but is what stands out for the section of code you’ve shown