Thanks for following up on your progress!
So, you've found out some great details. First, you mentioned that the headphones work without issue with your iPhone, and when using a third-party app the headphones worked for a time, and then stopped working after restarting the MacBook Pro. What this indicates is that the issue is likely a software issue with your MacBook Pro recognizing the headphones. If it were a hardware issue with the headphones, they wouldn't work on any device.
So, let's try a few more steps. It wasn't clear if you ran the Apple Diagnostic, or what results you received if you did. If you haven't tried that step, let's do it now, because if the issue is hardware related on the MacBook Pro, it may be able to spot that right away and you can move on to exploring service options, as none of the steps ahead will fix a hardware issue.
Once that's ruled out, you can Start up your Mac in safe mode and see if the behavior continues there. Safe mode may look a little different as it doesn't load all the features that would be loaded when you boot up normally, and refreshes several system files. This helps determine if the issue is a configuration issue with your user account. During these steps, be sure to refrain from using any third-party software to test with.
If the headphones work in safe mode, go ahead and restart normally and we'll see if the refreshed files fixed the issue. If the headphones still do not work in safe mode, we'll go ahead and restart and try creating a new user account on your MacBook Pro and checking to see if the issue happens when signed in with it. This will help us narrow down software conflicts as the cause of the behavior.
If you're still unable to use your headphones after these steps, you may need to reach out and Contact Apple for support and service to investigate further.
Good luck!