The Mishnah (Shabbos 12:5) rules that writing in the sand is permitted:
כָּתַב בְּמַשְׁקִין, בְּמֵי פֵרוֹת, בַּאֲבַק דְּרָכִים, בַּאֲבַק הַסּוֹפְרִים, וּבְכָל דָּבָר שֶׁאֵינוֹ מִתְקַיֵּם, פָּטוּר
One who writes in liquid, fruit juice, the dust of the road, scribe’s powder, or anything which does not last, is exempt.
The Shulchan Aruch (O.C. 340:4) advises against what the Mishnah clearly permits, stating:
יש להזהר שלא לכתב באצבעו במשקין על השלחן או באפר
One should be careful that he does not write with his finger in liquid or ashes on a table.
Later we see that the Kitzur Shulchan Aruch (written in the 19th Century by Rabbi Shlomo Ganzfried) forbids this action completely:
אָסוּר לִכְתֹּב אוֹ לַעֲשׂוֹת אֵיזֶה צִיּוּר אֲפִלּוּ בְּאֶצְבָּעוֹ עִם הַמַּשְׁקִין שֶׁעַל הַשֻּׁלְחָן אוֹ עַל הַהֶבֶל שֶׁעַל חַלּוֹן זְכוּכִית (שִׁמְשַׁת הַחַלּוֹן) וְכֵן בְּכָל דָּבָר, אַף עַל פִּי שֶׁאֵינוֹ מִתְקַיִּם
It is forbidden to write or to draw in any form, even with your finger, with liquid on a table or on condensation on a glass window, or with anything, even if it does not last. (Kitzur S''A, 80:63)
Why does the Kitzur forbid this if the Mishnah does not? We see somewhat of a linear pattern here: first, the Mishnah permits this action. Next, the Shulchan Aruch does not forbid it, but advises against it. And finally, the Kitzur forbids it entirely.
Perhaps, from a D’Oraisa level, writing in things that do not last is permitted, but later the Rabbis forbade it to keep people from coming to violate the Melacha of Kotaiv.
I can see two potential problems with writing in sand on Shabbos, one being an issue with Kotaiv and the other being Choresh. (But maybe since the sand is dry it would not violate Choresh at all.)
What is going on here?