Ipywidgets on jupyterlab with enterprise gateway gets stuck at Loading widgets

Jupyterlab version:

(base) root@091a6be1ef58:~# jupyter --version
jupyter core     : 4.7.1
jupyter-notebook : 6.4.3
qtconsole        : not installed
ipython          : 7.26.0
ipykernel        : 6.1.0
jupyter client   : 6.1.12
jupyter lab      : 3.1.6
nbconvert        : 6.1.0
ipywidgets       : 8.0.6
nbformat         : 5.8.0
traitlets        : 5.9.0

I am using it with enterprise gateway version 3.2.0 with a custom kernel. When i try the following code

from ipywidgets import Button, HBox, VBox

words = ['correct', 'horse', 'battery', 'staple']
items = [Button(description=w) for w in words]
left_box = VBox([items[0], items[1]])
right_box = VBox([items[2], items[3]])
HBox([left_box, right_box])

It just says Loading Widget and doesnt show the boxes

I dont see errors in the console as well. Any help is highly appreciated.