Got a stake of 4997.66904241. I suppose it is a lucky block.

BTX txid: f9327a5d5c9d6fa22b29c50cb24284cf1018991baac68204dccf71083287b9cd
It is! Congratulations!

Really?, based on the code that's in github I don't see how it can be.
It can be but the fees would have to be higher than the subsidy to reduce the 5000 reward to less than that. It calculates the subsidy, adds the lucky block amount if you draw a number less than 3 (5000 in this case), and then returns the subsidy plus the fees. If the fees passed in were higher than your subsidy before the lucky block was added, your overall reward will get reduced.
Probably makes more sense to simply return the reward (exact amount) if you hit one.
Yes, it's lower because fees are accounted incorrectly, but it's minor problem and probably not worth fixing (it would require hard-fork)