Dylan O’Brien and James Sweeney craft a kind of chemistry that is equal parts funny and heart-wrenching.