Why is p value different in same hypothesis? 
wilcox.test(weight ~ group, data = my_data, paired = TRUE)

wilcox.test(weight , group, data = my_data, paired = TRUE)


can anyone specify the difference to me with "," and "~" both are giving different outputs, whereas i use ggplot to see the data second one gives me the correct result that there is a difference in groups.

If you are using a console like rstudio then you can use the command ?wilcox.test to get the manual of the function.

if both x and y are given and paired is TRUE, a Wilcoxon signed rank test of the null that the distribution ... of x - y (in the paired two sample case) is symmetric about mu is performed

That's probably not what you want, compare the variable weight and group. The formula form seems better, although it won't know how to pair the weights. It would be more ideal to construct two vectors manually.
