Help with steering behaviour algorithm

Godot Version

4.2

Question

Hello guys. I am working on procedural dungeon generation and have been following this article. Basically it randomly generates rooms and then pushes them away using steering behaviour. This generally works, but I am facing a problem where the smaller rooms always end up at the bottom right corner with the big rooms on top. Can anyone take a look at my code and maybe point out some mistakes I made? Thanks a lot!

func _seperate_rooms():
	var is_overlapping = true
	while is_overlapping:
		is_overlapping = false
		for room in rooms:
			for other_room in rooms:
				if room == other_room:
					continue

				var room_rect: Rect2 = Rect2(room.position, Vector2(room.width * step_size, room.height * step_size))
				var other_room_rect: Rect2 = Rect2(other_room.position, Vector2(other_room.width * step_size, other_room.height * step_size))

				if room_rect.intersects(other_room_rect):
					is_overlapping = true
					var direction: Vector2 = room_rect.position - other_room_rect.position
					var distance: float = direction.length()
					direction = direction.normalized()

					var move_amount: Vector2 = direction * distance / seperation_factor

					room_rect.position += move_amount
					other_room_rect.position -= move_amount

					room.position = room_rect.position
					other_room.position = other_room_rect.position
				
				if not is_overlapping:
					room.position = Vector2(
						round(room.position.x / step_size) * step_size,
						round(room.position.y / step_size) * step_size
					)

	queue_redraw()
	finished_room_seperation.emit()