Whats the right table relationship for these entities?
I would simply have:
USER - ROLE - PROJECT
I presume a user cannot be part of a project without having a role? The ROLE table facilitates your many-to-many mapping between users and projects: one user can map to many projects (with each mapping requiring a role record) and vice versa: one project can map to many users.
Simply add a UNIQUE constraint on the (user_id, project_id) columns on the ROLE table to ensure the user exists only once per project in the ROLE table.
If you need to standardise a list of options to describe roles, then your second diagram suits best - which is the same as mine, with an additional table to describe roles.