It is invalid to have duplicated parameters. Their uniqueness is defined by a combination of their name and in.
According to the OpenAPI parameter names are case-insensitive. So as far as a valid spec goes param and PARAM are different.
But Headers are case-insensitive. So param and PARAM would be identical. It's a valid spec, but one of them is going to be ignored.
Because it's not invalid, throwing an exception may be harsh but a warning should still be added.