I want to float a widget on Prim

I want to float a widget on Prim.
I want the widget to remain floating on Prim even when the viewpoint changes.

I wrote the code referring to the object_info_widget tutorial, but it didn’t work.

This is my code.

    def __init__(self):
        position = self.get_position(prim)

    def get_position(self, prim):
        box_cache = UsdGeom.BBoxCache(Usd.TimeCode.Default(), includedPurposes=[UsdGeom.Tokens.default_])
        bound = box_cache.ComputeWorldBound(prim)
        range = bound.ComputeAlignedBox()
        bboxMin = range.GetMin() #bbox stands for bounding box
        bboxMax = range.GetMax()
        x_Pos = (bboxMin[0] + bboxMax[0]) * 0.5
        y_Pos = bboxMax[1] + 5
        z_Pos = (bboxMin[2] + bboxMax[2]) * 0.5
        position = [x_Pos, y_Pos, z_Pos]
        return position
    def on_build_widgets(self):
        with ui.ZStack():
                "background_color": cl(0.2),
                "border_color": cl(0.7),
                "border_width": 2,
                "border_radius": 4,
            ui.Label("TEST", height=0, alignment=ui.Alignment.CENTER)
    def on_build(self, position):
        self._root = sc.Transform()
        with self._root:
            with sc.Transform(scale_to=sc.Space.SCREEN):
                with sc.Transform(transform=sc.Matrix44.get_translation_matrix(0, 100, 0)):
                    self._widget = sc.Widget(500, 150, update_policy=sc.Widget.UpdatePolicy.ON_MOUSE_HOVERED)
        self._root.transform = sc.Matrix44.get_translation_matrix(*position)

The get_position function that retrieves Prim’s position appears to work well.
But the on_build function doesn’t seem to work, even though no error occurs.

How can I fix it?