I just found this post and have the same problem as the original poster. I have a 2021 MBP M1 and had recently upgraded from Ventura to Sonoma 14.4.
But I have the 24-hour time set as well as show 24-hour time on the Lock Screen. The date and time is correct for my time zone CET.
However, only when I reboot the Mac and get the very first Lock Screen the time shows in 12-hour format. But when my Mac wakes from sleep and shows the Lock Screen it shows the 24-hour time correctly.
I found some other post suggesting to use sudo rm /var/db/timed/com.apple.timed.plist but this did not fix my problem.
Does anybody have this exact problem and found a solution?