There shouldn’t be a difference, if you just reimplemented the sequential model using your custom one.
Did you run the code a few times and checked for small variations in the loss/accuracy?
Would it be possible to post both model codes so that we can have a look?