How to convert Proper Motion in RA & Dec to Galactic Coordinates
The DEC conversion in the question is incorrect.
Try this:
double DEC = dec * Math.PI / 180.0;

positionrotation looks like a composition of two rotations bringing (1, 0, 0) to the RA and DEC of interest.
It seems correct, but something like this would be easier to verify:
using Microsoft.Xna.Framework.Matrix;

Matrix positionrotation =
    Matrix.CreateRotationZ((float) RA) * Matrix.CreateRotationY((float) -DEC);

The units in vector are mixed up.
According to these Gaia DR2 docs, radial_velocity is in km/s.
pmra and pmdec are in mas/yr; dividing (*) them by parallax in mas (1 au baseline) gives results in au/yr. Try this:
using Microsoft.Xna.Framework.Vector3;

// conversion to km/s
double au_yr = 1.49598e+8 / 3.15576e+7;

Vector3 velocity = new Vector3(
    (float) radial_velocity, // km/s
    (float) pmra / parallax * au_yr,
    (float) pmdec / parallax * au_yr);

Vector3 vel_icrs = Vector3.Transform(velocity, positionrotation);

If galacticrotation is from equation 3.61 in these Gaia DR2 docs,
// Matrix galacticrotation as above except
galacticrotation.M12 = -0.873437f;

Vector3 vel_gal = Vector3.transform(vel_ircs, galacticrotation);

(*) Actual distance in parsecs may differ from the reciprocal of measured parallax in arcseconds, which may be zero or negative.