Thank you for this question. The main thing would have been to realise that in doing your phD you have more time to concentrate on any one subject matter than you will ever have during you academic life later on.
What do you wish you had known before doing a PhD?
I wish I could started to use RG earlier so that my PhD pursuit is not a lonely journey. I still recalled the moments when I was stuck in the lonely journey & didn't know whom / where to seek help. I'm not saying my supervisor didn't help much but certain dimensions of thought / struggle I need to go through personally.
I wish I knew research methodologies better - such as how to ask good research questions and select appropriate data collection methods etc.
BTW, far more important than your topic is your supervisor: it is a long journey as others noted, and you work with that person for years (and beyond). I did have great support when I restarted my academic career. First time around I have no guidance - and did leave academia because of that.