I assume you are using BertModel from the Huggingface repository?
If so, then you could compare all intermediate outputs to the original forward 6 method and check, where the difference occurs in your manual calculation.