No function clause matching in Ecto.Changeset.cast

Your Repo.get call in the controller seems to have returned nil meaning, that there was no item with the given id in the database.