Setting "missing" distance values to zero when training a neural network
The short answer is "it depends"

Is zero better than one or infinity?  It depends on the range of x-y coordinates that you use.  It also depends on your output.  If you go from (x,y) to something like z = x^2, then you're placing your "null" at a local minimum. So, if it's a car, I'm assuming you're using a forward-facing camera.  Do you really want your algorithm to see a bunch of "cars" bunched up at the origin?
By the way, where is your origin?  Upper left (like most image indexing)? Lower left (like a cartesian plane)? Center (if so, what direction is positive x and y?)

As for re indexing, what you can do is look at the previous frame (or frames) where your 32 objects are indexed, along with their position and velocity.  Then, look at the current frame and compare each object's position to the positions in the previous frame.  Assign the objects in the current frame the same id as the object nearest it in the previous frame.  You can break ties with velocity.

following up on your comments:

a neural network can learn any arbitrary function to any arbitrary precision.  Eventually.  If you want certain behavior at (0,0) that is dramatically different from behavior at (0+ε,0+ε), then your network will take a long time to converge.

I suggest seeing what kind of results you get by converting nulls to zero and then comparing it to other techniques.  Maybe replace null with the average of all the other cars, or set it immediately behind your ego vehicle (since cars primarily move forward, your network will probably put less importance on cars behind the ego car).