I wrote a mediocre book on a popular programming language, and have gotten something like 10-20keuros. It took a year to write it, dunno how many hours, but probably not a very good hourly pay.
It's based on anecdata but I think a non-fiction book - on average - still has a better ROI than a fiction book. While the outliers may make more money with fiction, the average writer will never make 10-20k from a fiction book. Probably an order of magnitude less.