mathematical optimization – Bug in NMaximize in 12.2?

It seems (clearly!) to be a bug in the preprocessing for the new convex optimizer. Use one of the other methods (e.g. "DifferentialEvolution"):

Trace(
 NMaximize(E^(-x^2) - 1, x),
 _Optimization`MinimizationProblem,
 TraceForward -> True,
 TraceInternal -> True
 )

Workaround:

NMaximize(E^(-x^2) - 1, x, Method -> "DifferentialEvolution")

(*  {0., {x -> -5.45643*10^-9}}  *)

Alternatively, you can turn off the convex minimizer:

Block({Optimization`UseConvexMinimize = False},
 NMinimize(-(E^(-x^2) - 1), x)
 )

(*   {0., {x -> -5.45643*10^-9}}  *)