You can either home and (if you want) probe manually after you turn the printer on, or include homing commands (and probing commands if you want) in the slicer start GCode.
The main problem was with where you had the probing commands, i.e. before many important parameters were set up. They would have worked close to the end of the file. However, it's generally a bad idea to have any movement commands in config.g for two reasons:
1. Safety: It's a bad idea to have machinery move as soon as you power it on.
2. If you have a power failure, then when the power comes back on you will not want the printer t home and probe with a print already on the bed.