Binning consistency in px.histogram

I am using histogram to show data from a database in monthly bins. The code looks like

    fig_in_out = px.histogram(

where Month_list is enumerating all month in YYYY-MM format covered by the range of dates from a start point until today. “kind” has two possible values (one kind is positive and the other is negative, which is why I have barmode="relative").

By setting nbins to the number of months I was hoping that my histogram would show one bar per months for each kind. And it does behave like that some of the time.

At some point during the month, the bars started to span two months instead of one. The first time it happened I doubled nbins thinking that may be it needed to take into account the number of colors. Then later, the bars started to show fortnights instead of months and I changed nbins back. And some time later I am back with bars covering two months instead of one. And on it loops.

I am guessing it has something to do with the number of data points in my series or possibly whether it is the first half of the month or not. But I really would like to figure out something that stays consistent over time and that I do not need to change every so often.

As it turns out, I figured it out after posting for help. Month_list was built for another workflow and on purpose did not include the current month. As soon as I had real data in the dataframe about the current month, the number of bins was off by one which caused some re-adjustments.
Still, it looks like the number of bins is adjusted in some ways by px.histogram internally since I often got half the bars I expected rather then n-1.