Thanks for the follow-up. I’m not familiar with how Kaggle kernels work, but based on your description it doesn’t seem to be sufficient to restart the kernel.
In any case, once you’ve “completely shut off” the Kaggle runtime, what kind of error are you seeing when running the code the first time?