If you get an error "An element with a “root” ID already exists" in your Magento 2, it is, most likely, related to a third-party extension that calls methods to re-render a page.

To fix the "An element with a “root” ID already exists" error:

1. Find a PHP file and a line that throws an exception.

2. Open CLI (terminal), navigate to the Magento root directory, and run the following commands to find the proper file:

grep vendor/ -re ' ID already exists'
grep app/ -re ' ID already exists'

As a result, you will get an output similar to this:

vendor/magento/framework/Data/Form.php: 'An element with a "' . $elementId . '" ID already exists.'
vendor/magento/framework/Data/Test/Unit/FormTest.php: $this->expectExceptionMessage('An element with a "1" ID already exists.');
vendor/magento/framework/Data/Structure.php: new \Magento\Framework\Phrase('An element with a "%1" ID already exists.', [$elementId])

3. Then open each file (except *Test.php) and put a backtrace and exit function before each throws an exception, for example:

if (isset($this->_elements[$elementId])) {
\Magento\Framework\Debug::backtrace(false, true, false); exit();
throw new LocalizedException(
new \Magento\Framework\Phrase('An element with a "%1" ID already exists.', [$elementId])

4. Save files, flush the cache, and refresh the page.

If the error appeared on an ajax request, check the network tab in your browser (resent Ajax request).

You will get a backtrace of the code execution, so pay attention to the lines related to custom/third-party modules, e.g:

Magento Code Backtrace

Try to disable custom functionality from these modules to see if this fixes the issue. Once you detect which module code brings the issue you will be one step closer to solving the problem.

Update the code to make this extension work well, contact the extension vendor (developer) and ask for the fix, or disable the module.