How to supply power outside under soffit
Gray Romex is normally type UF (underground feeder) look at the info printed on it it should say UV resistant, if it is it would be legal to attach it as you have in the photo if that low point is above 8’ (but look like a hack job) the part that would not be legal or “code compliant” would be plugging it in. There should be a splice inside the box that has the outlet, if the box fill is two large or two many wires for that sized box a larger box or box extension will be needed to make the splice.