Hi, if the filling was done without a proper cavity preparation, which could be by two ways- one, if the carious structure was not cleaned up properly, it leads to caries spreading underneath. Secondly if there is pulp exposure while deep cavity preparation, it leads to persistent pain after the filling. Please take an ray and go for a root canal treatment
to get rid of the pain. you may need a crown also if there is discoloration. Take care!