I found the problem: Flux CD was reconfiguring the deployment every X minutes, causing KEDA to scale down to zero the number of replicas and restart from scratch.