We consider the 4D gravitational model with a scalar field φ, Einstein and Gauss–Bonnet terms. The action of the model contains a potential term U(φ), Gauss–Bonnet coupling function f(φ) and a parameter ε=±1, where ε=1 corresponds to ordinary scalar field and ε=-1 - to phantom one. Inspired by the recent works of Nojiri and Nashed, we explore a reconstruction procedure for a generic static spherically symmetric metric written in the Buchdal parametrization: ds2=A(u)-1du2-A(u)dt2+C(u)dΩ2, with given A(u)>0 and C(u)>0. The procedure gives the relations for U(φ(u)), f(φ(u)) and dφ/du, which lead to exact solutions to equations of motion with a given metric. A key role in this approach is played by the solutions to a second order linear differential equation for the function f(φ(u)). The formalism is illustrated by two examples when: a) the Schwarzschild metric and b) the Ellis wormhole metric, are chosen as a starting point. For the first case a) the black hole solution with a “trapped ghost” is found which describes an ordinary scalar field outside the photon sphere and phantom scalar field inside the photon sphere. For the second case b) the sEGB-extension of the Ellis wormhole solution is found when the coupling function reads: f(φ)=c1+c0(tan(φ)+13(tan(φ))3), where c1 and c0 are constants. © 2025 Elsevier B.V., All rights reserved.