The long ID is just a temporary placeholder (actually, it should show '(new)' while the UI is open). The correct ID is only generated when the UI is closed. Otherwise, the issue you observed would be even worse, as a different ID would be generated with EVERY change of the descriptor. When the UI is closed, all items are taken from the temporary chest and moved into the final one. If you want to avoid this, place the inserter only after it’s configured, or configure a new, unconnected chest and copy the settings to the existing one.
By the way, you also have a similar problem with filter inserters. they already work and pick up items before you can configure the filter. The solution is the same. prevent the inserter from getting items ;-)