Elastic Security inside Kibana periodically stops responding and requires a Kibana restart

Elasticsearch is fine, Kibana logs show a bunch of timed-out detections but nothing else. I converted a bunch of painless scripted runtime fields to normal fields and the issue hasn't returned, so maybe that was what was causing it.