Yes, it was avoidable. Don’t pass out drunk in your car with a gun in your lap. Or better yet, don’t become an “aspiring rapper”.
If you're going to go about armed (as We the People have the right and duty to do), staying sober is a very good idea.