BEST environment for pupae are their own pupal cells. Next alternative is artificial pupal cell made for that particular specimen. Placing them on substrate won't help them, but may cause deformity upon emergence. He will be viable. The problem is, whether he can actually survive. If their wings couldn't fully eclosed properly, in worst scenario, a blister may occur, and eventually pop up, get infected, get killed..... As long as they survive, they will just live as is. Nothing you can do at this point, other than keep him in clean substrate, and have a full attention to it. If your beetle flip upside down, (other than a reason to dry himself on ventral side) make sure you flip him back. If it has deformed abdomen, issue might be on copulation...