Okay but the ship isn't "Comedy-class," it's "California-class." You can't just say they act goofy because it's a comedy here, there needs to be an in-universe explanation to justify the conceit in order for things to fit into continuity.
You don’t have to justify it anymore than there is a unique blend of personalities from other Starfleet ships.