The transition ran for 180 milliseconds without changing the panel's height.
The common read: a max-height transition animates the panel, so the panel starts closing on the first frame.
The panel was 4000px tall and stayed at exactly 4000px for the first 180ms of a 300ms close. The ceiling is 9999px and the content is 4000px, so the ceiling has to drop 5999px before it reaches the content height, and 5999 of 9999 pixels at a constant rate is 180 of 300 milliseconds. The pause equals the duration multiplied by the share of the ceiling above the content. Double the ceiling to 19998px for a taller panel, and the pause grows to 240ms.
Measured in Chromium, Firefox and WebKit at a 1280 by 800 viewport, the last frame reading exactly 4000px is at 175.2ms, 174.2ms and 166ms, and the first frame below 4000px is at 183.5ms, 182.54ms and 183ms. Frame timing sets the width of that bracket, and 180ms is inside it in all three.
9999 was a guess. A bigger guess makes the pause longer.

