Emitting multiple States for Single Input using ViewModelType architecture
Well, the fact that the result of the network request is needed in the next network request means you have a cycle which mean you have to have a subject of some sort. Also, you have to maintain state which implies a BahviorSubject rather than a PublishSubject.
That said, whenever you have an onNext inside a subscribe, there is likely a cleaner way.
class MoviesViewModel: ViewModelType {

    struct Input {
        let fetchMovies: Observable&lt;Void&gt;
    }

    struct Output {
        let movieSection: Driver&lt;MoviesViewModelState&gt;
    }

    private let repository: SyncRepository
    private let disposeBag = DisposeBag()

    init(repository: SyncRepository) {
        self.repository = repository
    }

    func transform(input: Input) -&gt; Output {
        let state = BehaviorSubject&lt;[String]&gt;(value: [])

        let movies = input.fetchMovies
            .withLatestFrom(state)
            .share(replay: 1)

        movies
            .map { $0.count }
            .flatMap { [repository] in repository.fetchNames(for: $0) }
            .withLatestFrom(state) { $1 + $0 }
            .bind(to: state)
            .disposed(by: disposeBag)

        return Output(
            movieSection: Observable.merge(
                movies.map { $0.count == 0 ? .loading : .loadRemaining },
                state.map(MoviesViewModelState.loaded)
            ).asDriverOnErrorJustComplete()
        )
    }
}

One of the interesting things to note is that the BahviorSubject does not need to be a property of the class. The bind will capture the subject for you.