RTX Lidar in Headless mode: No data is being read

I am trying to scan a scene using the RTX Lidar in Isaac Sim headless mode. However, the data i am getting is empty. I am sure there is nothing wrong with the configuration of the lidar and the positions since i have run this code using an extension and got normal output data. I suspect the issue is an update frame issue.

I just need to understand how to pace the flow of the code to get data from the annotator:

for lidar in lidars:
        print(f"LIDAR: {lidar}")
	    # 1. Attach render product
        render_product = rep.create.render_product(lidar.GetPath(), [1, 1])

    for render_product in renders:
        counter += 1
        # 2. Create Annotator to read the data from with annotator.get_data(). Make sure to set ObjectId output and transformPoints to World coordinates
        annotator = rep.AnnotatorRegistry.get_annotator("RtxSensorCpuIsaacCreateRTXLidarScanBuffer", init_params={
                    "outputObjectId": True, "transformPoints":True}) # Check out https://docs.omniverse.nvidia.com/isaacsim/latest/features/sensors_simulation/isaac_sim_sensors_rtx_based_lidar/annotator_descriptions.html for different outputs and annotators
        pc_data = None
	# 3. Accumulate points. Allow for one frame to pass to collect data
        pc_data= annotator.get_data()
        print("PC DATA: ",pc_data)
        object_id: list = pc_data["objectId"]
        print("DATA: ", pc_data["data"])