Depends on the story and how it's written for me. If the happy ending is contrived and makes no sense, then a tragic ending would have been better, and if the tragic ending is just a gut punch coming out of nowhere just for the sake of having a tragic ending, then a happy ending would be better