creme patissiere too solid I made a try of creme patissiere with 250 ml UHT milk at 1.5% fat (yes, hence I called it a try), two egg yolks, 22g corn starch, 70g sugar and vanilla. Direction as classic. Beat yolks with vanilla seeds and sugar, add starch. Meanwhile warm the milk and the vanilla bean and just before boiling add a part of it to the yolk mixture and stir; add more and then move everything back to the heat and stir until thick. Cool down in an ice bain marie. Let it sit at room temp with either film on the surface or a sprinkle of granulated sugar.

After less than an hour at room temp, I notice that the product is no longer creamy, became too solid and took the shape of the container. Far away from a cream. Can it be due to the lack of fat in the milk, it being UHT or too much time on the heat?
The starch was superfluous. Traditional creme patisserie is made without it. Some people do make custards which combine starch and yolks, but they are actually more difficult to work with. Also, from your ratios, the starch alone (without the yolks) would suffice to make the shape-holding pudding you described. 

You can repeat the whole cream without any starch, and as long as you use the right temperatures, it will give you a nice pastry cream. The UHT and the milkfat content are not a problem, you can do this with anything from pure water to conditor cream, and while you will get a large difference in texture between these two extremes, it will be a difference in "butteriness", you won't get a firm result.