Q. What is the punishment for unknowingly eating something that has gelatin or a Haram substance in it (food or medication)?
A. If someone has done this act unknowingly then he/she will not be held accountable and hence there will be no sin in doing so. A person should however ask Allah for forgiveness and should be more alert in future.
And Allah knows best.
Mufti Waseem Khan