Baby will only sleep on our chests

I have so many mixed emotions about co sleeping but my 5 week old will ONLY sleep while being held. Any time we lay him on his back he starts choking and gagging or his whole body with spasm and he will start awake like a rush of adrenaline. It’s terrifying to see and hear. I actually feel like he’s more at risk of sids when we lay him by himself, we have tried elevating his mattress from underneath and putting him on his side but nothing works besides him on his tummy on my chest or on my husbands chest. Then I read articles talking about how you shouldn’t ever let this happen, but even his doctor said he doesn’t know what to do about the choking when he’s on his back and told me the warning about co sleeping but then also told me to do what feels safest for the baby. Does anyone else have this issue? He seems safe and happy but I do lose sleep from being terrified that something might happen.