Okay first off. Attaching a hinge "post" to a building is not a problem. There are many cases this will be necessary. Footers on development houses within close proximity to each other for one. As long as you use the proper hardware and sealant, a wall mounted 2x4 will be stronger and less likely to sag as say a standalone 6x6. I've had to do similar things on many occasions. Most recently on a Charleston. However it was one complete section anchored to the wall with 2x4 and the gate was hung on the 6x6 it attached too. Also use grk lags for most of my wall mounts. Tapcons are kinda junky nowadays. I build gates for a living. And have never had a callback once. I'm the fucking gate master. Biggest issue here is the lack of 2x4 framing. Which you thoroughly laughed at😂. We have a subcontractor who keeps building gates like this. Literally just came home from repairing one. This guy friggin doubles up on the z brace and adds a sideways 2x4 for the latch to mount too. Adds 20 lbs of weight with no vertical framing. Absolute nightmare.