ColumnsAutoSizeMode.FIT_CONTENTS seems to randomly minimize the first few columns of my AgGrid table

I have an AgGrid showing a dataframe decently, although some of my columns have short field values/headers, which wastes a lot of space and forces the user to scroll tediously. So, I used the autosize feature like so:

from st-aggrid import AgGrid, ColumnsAutoSizeMode

df = read_table(sql,conn)
AgGrid(df, grid_options(df), columns_auto_size_mode=ColumnsAutoSizeMode.FIT_CONTENTS)

Note that I have configure_selection(selection_mode="single",use_checkbox=True) in my grid_options (and a couple other hopefully unrelated options).

This seemed to work, but then my AgGrid table started rendering with the first 2-3 columns at minimum width, hiding all values…and this happens maybe 50% of the time, give or take.

If I use the "suppressColumnVirtualisation":True grid option, all the columns always render minimized (default column width of 5).

I don’t understand the non-deterministic rendering behavior (reloading browser window with the same parameters) – is there some race condition I’m not seeing? In the meantime, I have to live with the functional-but-annoying default column widths.