g_date_time_format() explicitly says that it doesn't support 'E' modifier. Using it here causes any format string that use "%x" or "%c" under Thai locale to return NULL, causing breakage in e.g. gnome-shell screen recording in earlier versions.
I believe the original intent is to have Buddhist Era (B.E.) in the formated time. Unfortunately, I can't seem to find a format or modifier in g_date_time_format()'s documentation that will produce B.E., so this is the best I can do.