The problem is you aren't exporting DISPLAY. You need to prepend the command which needs it with /usr/bin/env DISPLAY=:0 (hardcoded, not flexible) or have a dedicated script which will more reliably get the active display and set the variable:
#!/bin/sh
# Save the file as setdisp in a directory in your PATH
# with chmod 755 /path/to/setdisp
# This is the X.Org version, for Wayland you need a different, but similar approach
disp=$(pgrep -a Xorg | sed 's/.*\(:[0-9]\+\).*/\1/')
[ -z "$disp" ] && { echo "X not running" >&2; exit 1; }
/usr/bin/env DISPLAY=$disp $*
And then instead of calling my_program call your program with:
/path/to/setdisp my_program
P.S: You seem to use redirection arrow for appending output to /dev/null, that is not necessary if you want to discard output. Just use normal redirection:
my_command >/dev/null
To also redirect stderr, use
my_command >/dev/null 2>&1
However, in this case, I would instead save the output to a log, to see any errors output by those commands:
my_command >> /home/my_username/my_command.log 2>&1
Of course, ensure the file exists with
touch /home/my_username/my_command.log