Based on prior readings, my assumption was that the Kelly criterion was to adjust leverage in proportion to the expected odds of winning. So in your backtest, you use mean and variance of returns to calculate projected winning odds?
Adjusting leverage in anticipation of low volatility or higher returns using momentum, treasury yield, seasonality curves as factors is legit (IMO). But I think the issue with your implementation is how you calculate the "odds of winning" or "expected value". You use the lookback window as backtest start to current day instead of a moving window of say, 1 year. This leads to some pretty large formation periods of a decade which includes a huge drawdown.
My python reading is pretty bad, but I think you are actually employing constant leverage in your code, as opposed to variable leverage suggested by the Kelly criterion.