Isn't this risky? I thought once they pass transition level they should change to local pressure... But is this not risky to put local pressure qnh before... risky in terms of separation wheter vertically or horizontally.
There is no risk in changing the altimeter at any time during the descent, as long as it is correct by the time you level off at your proper assigned altitude.
During the descent your displayed altitude may either be behind or ahead of whatever it would display if you were to level off above or below the transition. But that doesn't matter because you are not leveling off, you are in a descent and your altitude is constantly changing.
If you were to receive modified instructions to level off before the transition and you have switch settings early you would need to switch back. Otherwise, the vertical and lateral airspace around your descent would have already been verified clear by ATC before issuing the descent clearance.
The only practical effect is instrument lag: Your altimeter may indicate a different altitude than another aircraft, (that already has adequate lateral IFR separation!) as you fleetingly transition through that same altitude. It is a temporary condition, of extremely short duration, and is not a safety concern.
Yosef you are correct in the sense that setting local QNH before transition altitude during descent may be risky in the rare occasion the clearance to descent is abrubtly changed to an altitude above the transition level. In this case the plane's altimeter would read "wrong" unless the crew remembers to correct the altimeter setting.
Some may think this kind of situation is unlikely, but nevertheless it is possible. A plane may make a navigation error prompting ATC to halt your descent. Unforseen traffic may emerge (emergency, high priority military etc.) making it necessary to halt your descent.
Whatever the procedure pilot chooses to use for descents, it should contain memory item to check for correct altimeter setting when levelling off. If the changing of altimeter setting (well) above or below transition layer is based on SOP, usually a checlist but could also be a requiered memory item, it's ok, as the SOP's would likely contain altimeter setting checks for all actions relating to vertical movements. If, however, the QNH adjustment is done against SOP out of habit or for convinience, it is a potential safety issue.