Update on layout regression in 2.3.2

I had some problems with rendering basic two-plot grid (see the original post here).
Since the version 2.3.3 the behaviour indeed changed but stil does not match v2.2.3.

The basic server app can look like this:

from bokeh.plotting import figure, curdoc
from bokeh.layouts  import gridplot

class Layout:
    def __init__(self):
        self.layout = gridplot(
            [
                [figure()],
                [figure()],
            ],
            sizing_mode='stretch_both',
        )
        curdoc().add_root(self.layout)

Layout()

Then, without any template it renders as expected:

However with basic template like this:

{% extends base %}

{% block contents %}

<div>
    {{ embed(roots[0]) }}
</div>

{% endblock %}

It renders as follows

I can make it work by removing the div element, however as long as there are any other divs (which there are in my real app) it does not help.

Before filling bug report I would like to make sure I am not doing something wrong.

@mateusz would have to weigh in on this, but he only checks here periodically. If there is not response here in a few days please feel free to open an issue.