Assertion to find the difference between two clocks

The code you provided will always result in $realtime-first_change being 5 and clk2 being either 0 or 1. Consequently, the assertion will always fail.