Many-To-Many movie director system
When two entities are related in many-to-many relationship, neither of them are a parent/root entity nor a dependent/child entity. They are two individual entities totally independent of each other. They are related, but neither of them depends on the other.
At database level a parent/child dependency is mapped through a foreign-key. For a many-to-many relationship there is no foreign-key involved, and the relationship is mapped through a joining table, which we model with a joining entity at code level, (the MovieDirector entity in your example).
So, if Director and Movie are in a many-to-many relationship, then Movie is by no means a parent entity of Director, or vice-versa. Therefore, you should always be able to create a Director entity independent of any information referencing any movie. And from that perspective I see a major flaw in your code - currently you cannot create a Director entity independently, you need a movieId for that (which you shouldn't).
Think about a possible scenario where you might need to select one or more directors while creating a new movie, and that might be the first time some of those directors gets linked with a movie. What I'm trying to imply is, you can always have a director, or want to create one, for whom there is no movie in the database.
The signature of your CreateDirector method should be like -
public Director CreateDirector(Director director)

First setup any related entities (if there is any) before reaching the CreateDirector method -
director.MovieDirectors.Add(new MovieDirector { MovieId = movieId });

and then call for creating the new director -
public Director CreateDirector(Director director)
{
    _repository.Directors.Add(director);
    _repository.SaveChanges();
    return director;
}

Now you can create a director independently or, along with its related entities. I hope that simplifies your current approach too.