Hello Hanan, I think it works with a little change.
By default Kusto returns a set of data - just like any other database. But you don't want to return a set, you are returning a single value like: " | where timestamp = datetime(2022-12-24)". This is why you need to use toscalar.
lett = mytable | summarizemax(timestamp);
| wheretimestamp == toscalar(t);
Or if you are NOT searching for a single value but the whole set, you would use the IN operator, not ==