I have 3 versions of HDP in oracle virtual box. The versions are 2.5, 2.6.5 and 3.0. When i start VM for HDP 3.0 the Ambari UI works fine. But after that if i start VM for HDP lower versions 2.5 or 2.6.5 i can not open Ambari UI. It shows Server error. Based on the requirement i need to use different versions of HDP.
Also it might be related to browser caching issue as well. So can you please try using the "Incognito Mode in Gogle Chrome" (Firefox: Private Mode) when you switch from one ambari version to another in the same browser.
NOTE: you can not run two HDP sandbox instances at the same time on the same laptop as it will cause port conflicts.