Everyone is misquoting Trump
He never said the ceasefire would last for 24 hours, what he said was that Iran and Israel would never ever fire missiles at each other again. Obviously he didn't mean that literally, such a statement is absurd, so you need to understand that figuratively like the way they end fairy tales "and they lived happily ever after". Everyone knows that when a prince and princess get married there are lots of squabbles, lots of disagreements and even the occasional ballistic missile will be shot by each of them. Think of Prince Andrew and Sarah Ferguson or Prince Charles and Diana.