All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
All that is happening in the world is predestined by Allah. Allah Says (what means): {Indeed, all things We created with predestination.} [Quran 54:49]
However, if you do these acts by mistake and it is not due to negligence on your part, then you will not be held accountable for them, and they will be forgiven out of Mercy from Allah. Allah Says (what means): {And there is no blame upon you for that in which you have erred but [only for] what your hearts intended.} [Quran 33:5]
Allah also says (what means): {Our Lord, do not impose blame upon us if we have forgotten or erred.} [Quran 2:286]
It is proven in Saheeh Muslim that the Prophet said that Allah said after this supplication of the believers, “I have indeed done so”.
Nonetheless, if you were negligent, then you will be held accountable for your negligence.
For more benefit on doing something by mistake, please refer to Fataawa 367606, 358213, and 354937.
Allah knows best.