Thanks for the reply @rchadha! Copying the files from /build/ackermann_msgs/rosidl_generator_py/ackermann_msgs
to /isaac_sim-2022.2.1/exts/omni.isaac.ros2_bridge-humble/omni/isaac/rclpy/ackermann_msgs
fixed the issue.
As a future reference, you need to first load the humble extension and then import the msgs:
from omni.isaac.core import utils
utils.extensions.enable_extension("omni.isaac.ros2_bridge-humble")
import rclpy
from ackermann_msgs.msg import AckermannDrive