Ramp mechanics are just really poop in tf2. Some ramps are especially buggy like water ramps, so you might want to avoid these. Like RNC said, you get some kind of sticky wallbug behavior on ramps that are made of several parts, so you have to put a player clip on these.
You can make ramps more consistent by making sure the player hits it with a certain speed and angle, e.g. by putting a skip, surf ramp or speedshot before the ramp. Also make sure the ramp brush is on the grid and not rotated or something like that. But ramps will fail randomly anyway, you just have to live with that.
I don't think there is a perfect angle for ramps. You want different angles for ramps that you just slide up and lower angles on ramps for ramp shots.