Sounds like the battery my Tab S4 is now in the cupboard after facing a similar problem of unable to turn on then after format turns on but will not stay connected to wifi on off to the point of chucking it out the window .
Now solved by buying a Tab S8+ ????