We investigate experimentally and theoretically the dynamics of paramagnetic microrods anchored to a surface and driven by a precessing magnetic field. We identify two distinct regimes, corresponding to extended domains in the (omega, theta(B)) plane, where omega and theta(B) are, respectively, the frequency and inclination of the driving field. At low frequencies, the response of the rod is linear whatever is the inclination of the field, and the rod precesses at omega. However, above a characteristic frequency, two qualitatively different behaviors are distinguished, depending on the inclination theta(B). For small inclinations of the magnetic field, the response of the filament remains linear at all frequencies. Conversely, when theta(B) exceeds a critical value theta(Bc) similar to 55 degrees, the response becomes nonlinear, and the tip of the rod follows a complex trajectory exhibiting three-dimensional back-and-forth patterns. A minimal model, which neglects both the flexibility of the rod and the hydrodynamic interaction with the surface, correctly captures the main features of both regimes. We thus show that the complex trajectory patterns are chiefly due to the geometrical nonlinearities in the magnetic dipolar coupling. The critical angle is itself set by a purely geometrical criterium, arising from the magnetic nature of the rod. The paper is closed by a generalization of our results to the case of soft filaments.