FWIW, I have never experienced this when changing a device’s assigned driver.
Hubitat makes the code for a few example drivers available in their public GitHub. But if it’s not included there, then there is no way to see the code for any built-in drivers.