After reading your comment, I was interested in whether or not I could achieve this through the built-in Shortcuts app. Unfortunately, "Restart" is not an available action.
Edit: Actually, I was looking in the wrong place. It’s an option for the "Shut Down” action. Thanks, @jwond!
Just tried it. Unfortunately, even when you choose "Run Immediately", it still asks for user input when the time comes ("Are you sure you want to restart this iPhone?")