The first point in the buffer is 1, not 0 -- that is why the example produces an error message stating Args out of range . . .. The doc-string for
add-text-properties states that START and END are buffer positions, unless the optional argument OBJECT is a string. Since there is no optional OBJECT argument in the example, we are dealing with strictly buffer positions.
The first line of code,
(ignore "hello" "bye" "chalo"), serves no purpose and detracts from the issue.
add-text-properties is a built-in function in `C source code'.
(add-text-properties START END PROPERTIES &optional OBJECT)
Add properties to the text from START to END.
The third argument PROPERTIES is a property list
specifying the property values to add. If the optional fourth argument
OBJECT is a buffer (or nil, which means the current buffer),
START and END are buffer positions (integers or markers).
If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property value actually changed, nil otherwise.