Custom Role Allowing Things It Shouldn’t Be

This is happening because the ‘edit’ capability allows adding new posts/pages. A quick google shows there are ways to remove the creation capability; I haven’t tested any of them.