Pilots reported a NMAC during departure and cited ATC instructions as contributing to the event.
Synopsis
Pilots reported a NMAC during departure and cited ATC instructions as contributing to the event.
Narrative
Cessna 172 departed in front of me on a 'ZZZ Departure' The tower held myself 'for spacing' After about a 1 minute delay the tower cleared me for takeoff on an 'ZZZ1 Departure' During my takeoff; through the crosswind turn; the controller made a call to the cessna letting them know I was on the ZZZ1 departure behind them then had a stuck mic for 1 minute and 20 seconds. He then asked the Cessna if he had a stuck mic. I was handed off to Tracon while being given a wake turbulence advisory for a nearby airport inbound. The Cessna stayed with Tower. I saw the Cessna in front of me and opted to make a right to pass behind him and overtake to the right. Tower instructed the 172 of my position and suggested he make a climbing right turn to avoid conflict; but that was exactly where I was headed. I was talking to Tracon at the time so I did not hear this conversation. As I was passing the controller instructed him to make a left turn. In the moment I was a little confused because I felt like my actions were appropriate and didn't understand how I ended up with so little spacing. When I got home; I pulled up the ADS-B data and saw that that Cessna actually made a hard turn towards me. I looked up who the airplane belonged to and contacted the owner of the flight school. He did his own lookup into it and sent me the ATC logs; lead to me seeing that controller basically gave instructions to the Cessna to fly towards me.I had the Cessna insight the entire time; but I think the overtaking requirement to remain 'well clear' was not met. I did get a TA and a close up look of a 172 but did not get a RA and neither airplane had to take evasive action to avoid conflict. I had departed on the ZZZ1 departure and the overhead traffic and wake turbulence advisory prompted me to turn south further than expected after clearing the Delta. The owner of the flight school suggested I don't go south like I did on that departure; which I normally don't. The Cessna followed instruction but did a good job looking out the window in their right turn and halting it. Had the Tower cleared me to takeoff earlier while the Cessna was in sight and told me to maintain visual separation north of that traffic; the issue likely never would have occurred. The controller making resolution advisories outside of their airspace I would deem the primary cause for encounter being as close as it was.
Second reporter narrative
We departed ZZZ [airport] on a ZZZ departure. Aircraft X took off after us on an ZZZ1 departure. We flew direct Location A and then on course toward Location B as per ATC instructions. Aircraft X; after making it approximately halfway across the body of water; turned right 90 degrees and headed southbound directly towards us. Aircraft X was on ZZZ [TRACON]; us on ZZZ tower. Tower advised us of the Aircraft X coming up behind us and suggested a right 360. We did not have traffic in sight as they were behind. After beginning a right turn; Tower instead said to turn left and climb immediately. A few seconds later; Aircraft X passed just under our right wing and within ~100 feet of our altitude; slightly below. They overtook and then turned left towards Location B. Very near miss. As a result of our evasive climb; we got ~60 feet from the 2300 ft.Bravo shelf as well.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.