Another Mac Technician having suffered this same problem a coupla' years back;
Otherwise mint-condition MBP 15" 2012's WiFi would occasionally work but was essentially useless. If and when it worked at all, WiFi would never stay connected for more than a few minutes...
wasted time fooling around with software for a while, then replaced the AirPort / Bluetooth card with a brand-new one... still had exactly the same problem... frustrating!!!
Finally replaced the ribbon connector from MLB to Airport Card.
WiFi. now. perfect. FWIW, the failed cable showed NO sign of wear or damage & was probably defective the day it was made.
I have another 2012 MBP 15" waiting on the bench with the same symptoms except this one doesn't detect the WIFI at all but does see Bluetooth... will first try a known-good cable this time.
now where did I stash that Airport Card that I pulled on that last one... ?