It seems I have not payed proper attention to the numbers before answering.

So, my previous post just explains the diff for the 1st query between size vs spaceused.

For the diff between the query and the real file size on disk it could be cache. On db2 at least, this operation to evaluate dbsize is costly, specially on larger dbs with hundreds of datafiles, so db2 caches the information and perform this calculation only few times a day. When the user queries it, it get the last cached values which may not be accurate with the exact moment it was queried.

Not sure of mssql does something similar here. But that could explain the difference