The Apple Diagnostics and AHT can fail when a third party drive or battery is installed because those third party items may not behave in a manner Apple expects. Usually I would expect the failure to occur each time, however, there appears to be a bug when looping the test:
https://support.apple.com/en-us/HT203648
What do you mean by "funky"?
To check the health of the SSD run DriveDx. To look for possible software issues run EtreCheck. Post both reports here using the "Additional Text" icon which looks like a piece of paper.
What is the make & model of the memory you installed? Macs are very picky about the memory they use so it is best to only use memory from Crucial or OWC. Even then you need to purchase the exact part numbers suggested by the tools on their respective websites.
You can try running a memory test as well using Memtest86. You will need to Option Boot the USB stick and select the orange icon labeled "EFI" to boot Memtest86. You can use the downloaded Memtest86 .iso or .img file as a source for Etcher (Mac/Windows/Linux) to create the bootable Memtest86 USB stick. Just because no errors occur does not mean the memory is good.