This example code demonstrates my problem perfectly
from gekko import GEKKO
model = GEKKO(remote=False)
x = model.Array(model.Var,(10),lb=0, ub=2,value=0)
b = model.Array(model.Var,(3))
p = []
p.append(model.Param(sum(x)/10+0.25))
p.append(model.Param(sum(x)/10))
d = 1e-5
x_data = [-1e5,0.25,0.25+d,1,1+d,1.5,1.5+d,1e5]
y_data = [0.1,0.1,0.75,0.75,1.25,1.25,1.7,1.7]
model.pwl(p[0], b[0], x_data, y_data)
model.pwl(p[1], b[1], x_data, y_data)
model.pwl(x[0], b[2], x_data, y_data)
model.options.IMODE = 2
model.options.SOLVER = 1
model.Obj(-1*(b[0]+b[1]))
model.solve()
print(x)
print(p)
print(b)
This has a successful solution with an objective of 7.6 (not even sure where that comes from), but all x values are set to 0 except x[1] which is 1, which would mean that p[0] is 0.35 while p[1] is 0.1. This is not the case as both are equal to zero. b[0] and b[1] are equal to 1.7 which shouldn't be the case even if p[0] and p[1] were correct. b[2] is correctly set to 0.75.