The error message is very clear, you have 2 endpoints with different names but with the same method signature.
To quote
AmbiguousMatchException Class (System.Reflection) | Microsoft Learn[
^]
An
AmbiguousMatchException
is thrown when a member is invoked late-bound and multiple overloads satisfy the binding criteria, or when more than one member matches the binding criteria passed to a reflection method that can return only a single result (for example,
Type.GetMethod
or
Type.GetProperty
).
It also points to the 2 methods that have the conflict:
*
HomeController.Remove
*
HomeController.RemoveToCart
Change the parameters of one of the methods to remove the conflict. No code was supplied, so can't advise what to change.