I got the same error however it was caused by the ActionName attribute in my case.
[ActionName("")]
public void Get(string code)
Although this broke the Help pages I was still able to reach the endpoint api/controller?code=123. When I removed the ActionName attribute the error disappeared.