now if Alice reveals her value X then she will be able to get her bond money back. Suppose if Bob won the lottery then how will he get the money from Alice since she has already reclaimed her bond amount?
The transactions for revealing commitments are separate from the transactions for the lottery. Timed hash commitments only force parties to reveal preimage x of
H(x). The lottery logic is carried in a separate transaction