I just updated and had a look at the latest LUA git repository and the database_statistics script is not present.
If I have a look at the site you linked to and then got to the Darktable Erweiterung durch Lua Skripte link I see that this specific script, version 2.1.3, was last updated for darktable 3.2.0 (a tar file is provided on that page: direct link - Download für darktable 3.2.X (Linux).
A lot has changed over time, as I’m sure @wpferguson will agree with me, and I’m all but certain that that specific script needs some tinkering before it’ll work on the current darktable, or more specific, LUA implementation.
A quick look inside the lua script tells me that version 7 is not checked for. You might(!!) get away with adding ,{7,0,0} at the end of this line:
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0},{6,0,0})
So it becomes (one line):
dt.configuration.check_version(...,{3,0,0},{4,0,0},{5,0,0},{6,0,0},{7,0,0})
I did not test this…