There is the same code used in insert_tile_from_quadkey and the utils function get_geom_of_quadkey. insert_tile_from_quadkey should use the utils function.
insert_tile_from_quadkey
utils
get_geom_of_quadkey
\fyi @tara @shinde @laurens