No it doesn't. There's nothing in the constitution that grants immunity to a president and no reason why Donald Trump had to commit the crimes he's charged with.
You're suggesting presidential immunity is a new idea, and criminal charges against ex-presidents are a new threat to the executive branch, both of which were wrong. 230 years ago people had already through through this. Immunity isn't in the constitution because they didn't want it in there.
The president already has all the constitutional protection he needs from prosecution: a prosecutor can't remove him from office.