Your ‘Bounding Box’ curve appears to be incorrect.
Used code from the first link above with your contours: