iIt is quite obvious to me that the rasterset A, B within the NDVI equation, --calc='"((A-B)/(A+B))"' with cell_value=0 will lead to the above error (division by zero). How can I avoid the error?
You can not avoid the error but you can handle the error. If you post your code you might get a more specific answer. In any case have a look at Python error handling and more specifically how to handle zero division errors.
Something like this:
try: your code here except ZeroDivisionError: pass