Welcome to the I Feel Like A Lousy Parent Club. :smile: We've all been there and then some!
You've got enough going on here that I think it would be wise for you to step back from issues like potty training until you have a full picture through assessment and your own research. I'm in the middle of a paint project but some other moms should be along shortly to give you some ideas on that.
My difficult child is now 11 but once upon a time he was 4 years old and "very smart and is advanced for his age in a lot of areas" also "defiant, talks back a lot, and explodes if things don't go his way". He also was not toilet trained and would have irrational (to me) fears of things such as toilets clogging. I'd do exactly the same kinds of things as you described above for difficult situations only it would usually set us back 2-3 hours instead of 1. Unbeknownst to me my son's various difficult behaviors had a common underlying neurological cause. When we started getting some answers I wound up feeling terrible because many of his behaviors were very reasonable in light of his cluster of disorders. Here I had been pushing because "every other 4 year old" and because I felt it was my job to help tone down his defiance. What my son really needed was to be understood and to overcome and learn to compensate for his issues.
You've only told us a little but since you've come looking for answers and help I hope you'll keep that in mind. I needed more information and a whole different game plan to help my son become who he was meant to be instead of floundering around on the parent-child battlefield.