Say that you want to select all installed weapons up to 1499kg, you would write a string like `"w <#1500"`
This works fine in the console, however, this generates a spurious "invalid element tag #1500" error.
Similarly, trying to select up to 1500kg inclusive results in a string of `"w <=#1500"` which again throws an error, this time "element tag expected" and the line number it will point to is likely not even going to be the correct line!
Again, the criteria string works just fine in the console, or any mod that allows you to type the criteria string into a text field.

nms 18 Apr 2023:

You can't use the < symbol for anything other than opening tags in XML (unless it's in a CDATA block, which is weird looking and not usually worth it). You can substitute &lt; when you need it in tLisp code.