the problem is with your function "g". As mathematica trials different values of f1, f2, seeking to minimize g[10,f1,f2,1500] it finds a set of values for f1 and f2 that gives a complex result.
This can be fixed by changing g to avoid it taking complex values. *Perhaps* it might be appropriate to introduce a Re function in part of your definition of g to get rid of imaginary values far from the minimum. Use caution if you do this.