Given that bokeh (2.x) CSS layout engine needs a layout invalidation using view.invalidate_layout, it might be the case that an ipywidget needs to call the invalidate_layout method.
For example, if the view creation uses react rendering (react-widget-cookiecutter), it might be the case that the rendering inside the div is done after the component is mounted causing bokeh to mess up the layout.
It will be helpful to attach the bokeh view to the DOMWidgetModel so that a custom widget can use the bokeh view methods if need be when used in a bokeh environment.