If Ai generates something of kufr/shirk without us prompting it or expecting it, and I correct it by getting rid of the generation, does that count as me having said the kufr and do I become a kaffir because of this? I am urged to renew my shahada and Islam but I am not sure, what to do Ustadh?

Ustadh AbdulAziz al-Haqqan
This means that you need to seek medical help so that they can help you with the OCD problem, which should be your main focus right now, insha'Allah.