As you say, he appears to be able to control when and where this happens as he followed you to bed purely so you could see him do it. Yes, he might have some kind of anxiety/depression/MH problems, but his behaviour is about more than this. It isn’t your job to watch so you can support, and nor is it your job to go to a gp to get support to support him doing this! It is all 100% unacceptable of him. Firstly to be even doing this in your presence, secondly by insisting you need to be there for it and finally by insisting it is your job to support him, so much so that you need to go to the gp yourself!
He has clearly refused to get any help for his, which makes me think he is doing it deliberately (to a point, or entirely) and he certainly doesn’t want to change his behaviour or stop. He likes and (seemingly) thrives off your attention. Does he do it if something goes a bit wrong at work? Or around other people? And by his reasoning should you be there watching him if he self harmed by - eg - cutting himself, watching him bleed everywhere, just so you can “support” him? The answer to that is just “no”, and the same goes for his favoured form of “self harm”. I “” it due to feeling quite dubious that it actually is self harm in his case. Maybe it started out that way, who knows, but at this point, the way you tell it, he’s doing it for attention. The fact that he even followed you to bed to do it and prevented you sleeping as you wished/needed, sounds like it really is abusive behaviour by this point.
How (if) you wish to deal with this issue from him on out is entirely your decision. But you are not his emotional support “animal”, you have tried to support him by suggesting him seeing someone, not by encouraging him to keep doing it. BTW, it really shouldn’t be your job to try and get a grown man to go to the doctors anyway. He’s an adult, ffs. But you have tried and you have offered but it has been refused, as that simply doesn’t suit him and his narrative, and he prefers (chooses, remember) to want to control you by this method instead. It would seem tho that he does see your role as that of his emotional support animal. Id just make it clear - every single time he does this - that you are not his support dog/cat/iguana and that if he chooses not to help himself then there’s nothing more you can do and you’re just not interested anymore. Be careful and watchful for any attempts by him to try and ramp up any control, abuse etc, as he sounds as though it really could start once you start ignoring his behaviour.
Personally, this behaviour is a real warning sign, tbh, and once you start to ignore it when he does it, as much as you’re able to, the possibility of further behaviours, directed at you, would be a very real risk waiting to happen, and I would just get away from him permanently. As I say, that is just my own personal opinion of what I would do, I feel that is an extremely valid reason to end the marriage. You’ve given support, you’ve offered to help him find support to help him stop, but he simply doesn’t want to. That would be it for me.