I think you need to read a bit further, several of the pins need to either be open or left in a define state during reset. Your symptom is indicative of that problem.
I am not so sure.. the esp32 will reboot and execute code until the line of
Wire.begin(7,8); // causes reset
at which point it crashes
(I made the code really simple to demonstrate the issue)
I was interested in anybody that had actually used the Wire class, on the esp32 defining other pins than the default, as it appear that no matter which pins I select, the esp32 will crash. - So wonder if its not true to say on esp32 you can use 'Any pins' or the Wire class has an issue.
It would be surprising if after all this time the Wire class for ESP32 had an undiscovered 'issue' whereby you cannot re-assign pins for I2C and the ESP32 always crashes if you do.
For sure I have had I2C working on non-default pins of an ESP32CAM, no problems at all;
Yes, it can be real devastating to find that not all pins on a ESP32 are not created equal. All those little pins cannot be used. Heck, if you look at the developer boards, you should see the 4th pin one each side of the developer module, as counter from the USB plug, is a square instead of it being a circle; like the rest. That square pin is the first pin you can use.
Next you got to be careful with the use of the TCK, TDI, and TMS pins. Any device that is connected to those pins should not be able to change the pin level during programing. One could get some results that are very difficult to fix.
Then you got to know the difference between PortA and PortB.
So, to get over not all pins can be used on a ESP32, I had a few shots and then got back to my task at hand.