Many possible reasons. To start with a few...
Are you using LibrePilot software? This is not the way the default settings of LibrePilot work for a properly mounted, erased, configured, and calibrated CC3D board.
Are you using a CC3D or equivalent board? You didn't say.
Are you using the default settings? Like you get after Firmware -> Erase Settings (and then running the Welcome -> Vehicle Setup Wizard and the Configuration -> Attitude -> Calibration...)
Is the CC3D board mounted flat with the chips on top and the painted arrow pointing forward (6x3 connector pins that are connected to ESCs/servos are on the right hand side)? This is the default mounting orientation and to mount it otherwise requires that you change some settings to tell the configuration that you have done that.
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/2818092/CC+Attitude+ConfigurationWhat flight mode is this and how are you determining that it returns to zero? To start with you should use Attitude mode which is self leveling. If you are looking at the graphical flight displays on either the FlightData tab or the Firmware tab, you are OK. There are graphs accessible from the Scopes tab that you might find misleading. For instance, on the Scopes tab, some graphs show zero when it is level and some show zero when it has stopped rotating (roll/pitch/yaw) whether it is level or not.
Further reading:
https://forum.librepilot.org/index.php?topic=4408.0