You need to understand the difference between a # 1156 bulb, a # 1157 bulb, and their corresponding sockets.
Remove the bulb and take a look into the socket. Does the socket have 2 small terminals at the base or just 1 terminal? I doubt it would be just 1 terminal , meant for a 1156 bulb. A proper tail light uses a #1157 bub, which has 2 filaments, and needs a socket with 2 terminals at the inside base. The shell of the socket is the ground connection, which needs to have a third wire , assuming a dual filament socket/bulb is used.
Many parts on the stock XS650 are rubber mounted including the rear fender. For this reason, the stock harness ran a black ground wire from the rear tail light forward to connect into the common frame ground of the bike.
If your bike is customized, then the fender may or may not be grounded. You're still better off to run a ground wire from a proper bare metal frame ground.