Turns out the problem lays in setting the initial dof states and initial position targets. After adding the following, the problem dissapeared:
# set initial dof states
gym.set_actor_dof_states(env_ptr, franka_actor, default_dof_state, gymapi.STATE_ALL)
# set initial position targets
gym.set_actor_dof_position_targets(env_ptr, franka_actor, default_dof_pos)