The error in this case can be avoided by using the Zero Width Non-Joiner (ZWNJ) 4 Unicode character but Urdu users are generally not aware of its existence and most Urdu keyboards also do not have a direct key mapping for this character.
an extra space within a word creates two (or more) separate tokens for a single word and creates a computational problem.