Problem casting to static mesh component of an actor. C++

Hello. I have been working with Nvidia Waveworks recently and have an issue.
I have a component called WaveWorksFloating that has a UStaticMeshComponent* variable name BuoyancyBodyComponent. When I attach WaveWorksFloating component to a static mesh and use this cast to set it:

BuoyancyBodyComponent = Cast<UStaticMeshComponent>(GetOwner()->GetComponentByClass(UStaticMeshComponent::StaticClass()));

It works as expected. However, when I attach WaveWorksFloating to a blueprint actor or c++ actor that has a Static Mesh Component, it no longer works. I am having a hard time trying to fix this and could use some help. Thanks
link to image of issue on imgur

It randomly started working. Not sure what changed, maybe the waveworks actor needed to be refreshed? Idk.

When you get quirky behavior, or things you know are correct aren’t behaving. Its worth it to make sure the project compiles, then close Ue4 and rebuild the derived files.